linux basics
linux basics
Here are some basic commands to get you started in the wonderful world of Linux and other
UNIX variants. Near the bottom are commands dealing with tar/gzip/bzip2, compiling, and
Linux RPM management. All UNIX and Linux commands are case sensitive.
cd
Change directory. This is the command you use to change into different directories. An
example would be "cd /mnt" (minus the quotes, always minus the quotes) now you will
be the /mnt dir.
mount
Mounts a filesystem. ex, "mount /dev/hda4 /mnt" mounts hard drive partition 4 in
your /mnt directory.
cp
Copies files. eg, "cp SomeFile /home/momo/" copies a SomeFile into user momo's
home directory.
mv
Move. Does the same as cp except moves the file instead of copying it. You also use
the mv command to rename files/directories ex, "mv file1 SomeNewFilename"
renames file1 to SomeNewFilename.
mkdir
Make Directory. ex, "mkdir /home/momo/new" creates a directory named new in
momo's home directory. If you are currently in the directory you want to make the the
new directory in you can just do "mkdir new" to make a directory named "new".
rm
Removes files and directories. ex, "rm file1". To use rm without a hassle you may want
to use "rm -rf". This way you won't be prompted to confirm the removal of the file. You
can not use rm to remove directories which are not empty unless you use an option
telling rm to do otherwise, the -rf option works well for this. Use "rm -rf" carefully ;-).
rmdir
Removes empty directories. ex, "rmdir new".
man
displays the man page for a paticular application or command. ex, "man rm". Man is
your friend, please use it :-) .
For Example:
man pwd You will see the manual for the pwd
command.
For Example:
mkdir temp Creates the directory temp.
For Example:
rmdir temp Removes the directory temp.
If you see such a long list of files that they scroll off the
terminal screen, one way to solve the problem is to use:
For Example:
mount /mnt/floppy Allows you to use the floppy drive which
has directory name /mnt/floppy
You may run into problems moving large files onto a 1.44MB
floppy disk. One option to fit larger files is to create a zip
archive containing the file onto the floppy. For Example:
zip /mnt/floppy/myFile.zip muon.myDataRun
Moves the file muon.myDataRun into a
zip file on the floppy named myFile.zip
After you are done and before you eject it (this is very, very
important), you must unmount the floppy.