SOME BASIC LINUX COMMANDS by uez19567

VIEWS: 0 PAGES: 2

									                      SOME BASIC LINUX COMMANDS
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

chmod       changes the permissions for a file; permissions should include a letter designating
permissions who gets permissions (u for the user, g for the group, o for others, or a for all)
filenames   followed by a + or - (to give or take away the permission) followed by the kind of
            permission (r for read access, w for write access, x for execute if the file is a
            program or script); the complete command that you type should look like:

               chmod g-w filename


clear          clears the screen
ls [-l] [-a]   lists the files in a directory; -l displays detailed informtion about each file and
[-p] [-r] [-   directory, including persmissions, owners, size and time/date when the file was
t] [-x]        last modified; -a option displays all the files and subdirectories including hidden
               files (with names that begin with a dot); -p displays a slash at the end of each
      directory name to distinquish them from filenames; -r displays files in reverse
      order; -t displays files in order of modification time; -x displays the filenames in
      columns across the screen.
ps    displays information about your processes/jobs/programs which are running on
      the server
pwd   displays the current working directory

								
To top