Basic Command Line

cd directory 

    change the current directory to directory 

ls [options] [directory] 

    list the current directory's content

ls -l 

    list the current directory's contents, along with sizes, permissions, ownerships and dates of files

ls -a 

    list all files, including invisible files (files whose names begin with a period)

chkconfig --list 

    (--) character consist of two(2) (-) minus signs, this command checks the currently loaded daemon services and it's status

    ex.: 

         chkconfig --level 3 httpd on

         (this command set level 3 active for Web Server daemon)

service daemon start 

     this option will start a particular daemon services for the current terminal.

     ex.: 

          [root] $ service nfs start

          [root] $ service nfs status

ps -Cdaemon 

     check the process status to see if the necessary daemon are running.

     ex.:

          [root] $ ps -Cnfsd

          [root] $ ps -af  (show full listing of process info)

pwd [option] 

     print the working directory (the one you are in)

rm [option] 

     filename remove filename

mkdir [options] 

     directory_name make a new (empty) directory or folder

rmdir [option]

     directory_name remove an empty directory

cp [option] src_filename dst_filename 

     copy a file

mv [option] src_filename dst_filename 

     move (or rename) a file

cat [options] filename 

     concatenate a file to the standard output (that means display the file)

more [options] filename 

     paginate a file less [options] filename paginate a file

touch [option] filename 

     make a new (empty) file, changing the access data of an existing file

chown [options] filename 

     change the owner of a file or directory or folder

chgrp [options] filename 

     change the group of a file or directory/folder

chmod [options] filename 

     change the permissions of a file or a directory

     fixed values:

              read - 4,  write - 2,  execute - 1

     or ; 

              u - user, g - group, o - other

     ex.: 

              chmod o+rw MyFile_or_Folder 

              (this read/write to other users)

sort [options] filename 

     sort a file in a particular order

echo [options] text 

     string echo on screen what was typed after the command

     ex.:

         echo localhost.localdomain >> /etc/hosts.equiv

         (append the localhost.localdomain to the file hosts.equiv)

date [options] test string 

     read the date and time (without an argument); set the date and time (with an argument)

cut [options] filename 

     break a wide file into multiple narrow file

sed [options] filename 

     stream editor for large files or real-time files

ln [options] source_filename/directory target_filename/directory 

     link a filename to another file

grep [options] filename 

     searching program that uses general regular expressions to find data, and then prints it to it's output.

     ex.: 

          grep '^DocumentRoot' httpd.conf

          grep -i udbc httpd.conf  

          (for caseless search)

find [option] filename 

     this command will search for a particular file or text, depending on the setup or parameter passed on to it.

     ex.: 

         find / -name filename 

locate ' string text ' 

     is similar to the find command but provides a better search option which by passes the security or rights issue

     ex.:

         locate '*.bmp'

         locate '*.jpg' > graphfile  ( redirect the result to a file )