Important Key Combination 

      • CTRL+C – To halt the current command.
      • CTRL+D – To save the written file contents/generate end-of-file character/Logout the current session, similar to exit.
      • CTRL+G – To resume flow of long output of the screen stopped by CRTL+S, so that screen passes fastly.
      • CTRL+Q -To restart the output to continue on the screen.
      • CTRL+R – Used to type to bring up a recent command.
      • CTRL+S – To stop flow of long output of the screen temporarily so that a user can read it easily.
      • CTRL+U- To erase whole line in the current cursor line from a paragraph of text.
      • CTRL+W – To erases one word in the current line.
      • CTRL+Z – To stops the current command, resume with fg command in the foreground or bg command in the background.
      • !! – Used to repeat the last command. 
      • exit – Logout the current session.

Unix/Linux Commands

Common Conventions regarding Unix/Linux Commands 

  •  Unix/Linux commands are usually written in lowercase letters.
  • The syntax of typical Unix/Linux commands are  – 
    • Commands without options/arguments
      • Syntax : – $ command_name (press enter) 
      • Example – $ clear/$ date/$ pwd (press enter)
    • Commands with options/arguments
      • Syntax : – $ command_name options arguments (press enter) 
      • Example – $ ls -x  (press enter)              
  • File name must be used with its extension name, if any.

Category of Unix/Linux Commands 

  • Linux has a large family of commands, some of them are quite powerful.
  • Incidentally, most Linux commands are represented as files in the system.
  • There are following categories of Unix/Linux commands –

(a) Directory Commands

  • Those commands which are mainly responsible for directory related process/operations.
  • Examples are – cd, ls, md, rd, mkdir, rmdir, pwd etc.

(a) File Commands

  • Those commands which are mainly responsible for file related process/operation.
  • Examples are – ls, cp, more, less, cat, cmp, comm, mv, rm, chmod, file,head, tail, grep, sort, diff, man, touch etc.

(i) File Editors for creating and editing files – vi, joe, vim etc.

(ii) File Operation Commands – ws, sat, cut, dd etc.

(b) Input/Output Commands

  • Those commands which are mainly responsible for input/output related process/operations.
  • Examples are – read, echo, etc.

(c) Process Commands

  • Those commands which are mainly responsible for system related process/operations acts on user given jobs.
  • Examples are – ps, top, kill, bg, fg etc.

(d) Mathematical Commands

  • Those commands which are mainly responsible for arithmetic  process/operations/calculations.
  • Examples are – bc, expr, factor, units etc.

(e) Searching Commands

  • Those commands which are mainly responsible for finding unique contents from a files or memory.
  • Examples are – grep, pgrep, find, locate, which, whereis, whatis etc.

(f) Printing & Formatting Commands

  • Those commands which are mainly responsible for printing contents either from files or memory on the page as hard copy for further use.
  • Examples are – lpq, lpr, lprm, lprloc etc. 

(g) Disk related Commands

  • Those commands which are mainly responsible for physical drive/ hard disk related process/operations.
  • Examples are – du, df, fdisk, lshw, sfdisk, free etc 

(h) Network Commands

  • Those commands which are mainly responsible for handling computer network related process/operations.
  • Examples are – ipconfig, ip, ping, netstat, ss, traceroute, wget, dig, whois, w, whoami, finger,  etc.

(i) Setup Commands

  • Those commands which are mainly used for  system setup process/operations.
  • Examples are – date, passwd, env, set, alias, stty etc. 

(j) Status Commands

  • Those commands which are mainly used for giving the status of process/operations.
  • Examples are – logout, finger, ps, history etc

(k) Program Controls Commands

  • Those commands which are mainly responsible for controlling the program related process/operations.
  • Examples are – jobs, bg, fg, sleep, kill, nice, renice, &, ps, who, man etc.

(l) Data Editing Commands

  • Those commands which are mainly responsible for editing the data stored in a file/memory related process/operations.
  • Examples are – pico, vi, gnuemacs, diff, sort, wc, look, awk etc.

(m) Compression Commands

  • Those commands which are mainly responsible for compressing the data without degrading the quality stored in a file/memory.
  • Examples are – tar, gzip etc.

List of Unix/Linux Commands

(Alphabetically) 

A

  • alias

Definition
      • The alias command provides us to give/put our own short name to a unix/linux command or sequence of commands.

      • When we use/type an alias name in place of linux command name it works, and thus, saves a few keystrokes/time.

      • Once Aliases defined on the command line, it will die with the closing of terminal window. 
      • To make aliases always be available to us, it is better to add them to the.bash_aliases file in the home directory of linux.
Syntax
      • $ alias alias_name = Unix/Linux_commands_name.
Example
      • $ alias cls=clear.
      • $ cls (press enter)   [Clears the screen].
  • atq

Definition
Syntax
Example

B

  • banner

Definition
    • This command is used to display/print the string message on the screen as floating/animated form, normally in capital letters.
    • On each line, it displays a maximum of 10 characters.
    • The message appear on the screen with # sign, by default. We can change the default symbol # with any other symbol such as * symbol – $ banner codershelpline : tr “#” “*” (press enter) now # symbol is replaced with * symbol.
Syntax
    • $ banner messagetext (press enter)
Example
    • $ banner codershelpline (press enter) [display only 10 chars in one line as capital letters]
    • $ banner coders helpline (press enter) [display chars in two lines from space position, i.e. coders in first line and helpline in second line as capital letters]
  • bc

Definition
    • This command makes any type of arithmetic calculation as calculator and get result immediately.
Syntax
    • $ bc (press enter)
Example
    • $ bc (press enter)
_   2+5+6 (press enter)
     13 (Output)
     Press CTRL+D to come out from bc command.
$_
  • bg

Definition
    • This command sends the recently (suspended) foreground process in background.
Syntax

$ bg  process id/job_spec (press enter)

C

  • cal (Calendar)

Definition
    • This command is used to see the calendar of any specific/complete month or year or date, depend on what the system date has been set to.
    • This command displays the day/month/year details between 1 and 9999 year.
Syntax

$ cal option/arguments (press enter)

Example
    • $ cal (press enter) [ Display the current month calendar]
    • $ cal  4 2005(press enter) [ Display the calendar of April month 2005]
    • $ cal 4(press enter) [ Display all the months of year 4]
    • $ cal 1990 (press enter) [ Display all the months of year 1990]
  • cat (concatenate)

   Definition

    • This command performs the following functions –  

(i) This is faster than opening the file in a vi editor, and there’s           no chance to alter the file accidentally.

(a) This command can be used to displays the contents (only last 24 lines ) of single/multiple files on the terminal/screen.

Syntax : $ cat filename (Press Enter)  [For single file]
Example : $ cat file1.txt (Press Enter)
Syntax : $ cat filename1 filename2  (Press Enter)  [For multiple file]
Example : $ cat file1.txt  file2.txt (Press Enter)
    (b) This command can be used to displays the contents page wise (less command can be used) of single/multiple files on the terminal/screen.
Syntax : $ cat filename |less (Press Enter)                    [For single file]
Example : $ cat file1 |less (Press Enter)
Syntax : $ cat filename1 filename2 |less (Press Enter)                          [For multiple file]
Example : $ cat file1 file2 |less (Press Enter)

NB : To move/scroll page forward and backward we can use Up or Down Arrow keys  or PgUp or PgDn keys, or the Home or End keys. To come out from ‘less ‘ option,  press  ‘q’ button to quit from less option.

(ii) This command can also be used to combines/copy the contents of multiple files into another single blank file by copying it.

Syntax : $ cat filename1 filename2 > filename3 (Press Enter)                          
Example : $ cat file1 file2 > file3 (Press Enter)   [Here file3 contains the copied contents of  both file1 and file2]

(iii) This command can also be used to add the contents of multiple files into another existing file (at the end of the file).

Syntax : $ cat filename1 filename2 >> filename3 (Press Enter)                          
Example : $ cat file1 file2 >> file3 (Press Enter)   [Here file3 assigns the contents of  file1 and file2 at the end of it]
  • cd (Change Directory)

   Definition

    • Used to change the current working directory i.e. it moves to a new directory.

   Example

(i) $ cd\  (Press Enter)   [Change current working to root directory in one go.]

(ii) $ cd .. (Press Enter)    [Back one directory(i.e. parent directory) from current working.]

(iii) $ /usr/dummy/prg  

        $ cd /usr/dummy (Press Enter) [To come out from prg directory to dummy directory.]

(iv) $ /usr/dummy/cd dir1  (Press Enter)    [To go into new directory (dir1) from current working directory(dummy).]

       $ /usr/dummy/dir1

  • chmod

Definition
    • The chmod command is used to set a new/change the old file access permissions flags of a file or folder stored in memory for security purpose.
    • The file access permission flags define who can read(r), write(w) to or execute(x) the file.
    • When we list the stored files using ls -l option we see a string of characters(10) in the following format that appear as –
      -rwxrwxrwx
      • Here the first character format of string is a then the item is a (ordinary type of) file, if it is a d in place of – symbol then the item is a directory. The rest of the 9 strings for file access permission which is further divided into three sets of three characters (rwx). From the left, the first three represent the  owner file permissions , the middle three represent the group/group members file permissions and the rightmost group of three characters represent the other users permissions .
    • If the letter r, w, or x character is present in format of strings then it is considered that file access permission is granted and if the letter is not present/missing or a – symbol appears instead, then that file permission is not granted/given. If all the 3 letters are present in a set of format strings it means that a particular category of user has full access permission otherwise partial access permission and in the case of no letters i.e. no access permission.
    • There is way to use chmod command to provide the permissions to the owner, group, and other users as a 3 digit number. The meaning of each digit we can use or what they represent are listed below :-

      0: No permission
      1: Execute permission
      2: Write permission
      3: Write and execute permissions
      4: Read permission
      5: Read and execute permissions
      6: Read and write permissions
      7: Read, write and execute permissions

For example – If a file(say abc.txt) has all three sets of characters as rwx. It means that everyone has read, write and execute rights with this file (abc.txt) .

    Syntax
      • To set the permission to be read, write, and execute for a file (choose 7 from the list) for the owner; read and write for a file (choose 6 from the list) for the group; and read and execute for a file (choose 5 from the list) for the others. Thus, to set the above permission in a file,the command will be given for that specific file is –
        $ chmod -R 765 abc.txt (press enter)
    Example
      • We can see the permission of a file, we simply use – 

    $ ls -l abc.txt (press enter)

    • chpasswd

    Definition
    Syntax
    Example
    • chown

    Definition
      • This command allows to change the user, owner or group of owner of a file/directory or both.
      • As we know that in Linux, all files/directories are associated with an owner and a group ownership along with permission access rights for the file owner, the group members, and others.
      • Normal users can change the group of the file only if they own the file and only to a group of which they are a member.
      • Administrative users can change the group ownership of all files.
      • Each user has a default group created when the user is created. That user is the only member of that group. This shows that the file is not shared with any other groups of users.
      • To see the owner/group details of a file, we use the ls -l command.

    ls -l example.txt (press enter)

    (The first output of these indicates the name of the file owner, and the second output shows that the name of the group owner.)

    Syntax
      • chown [OPTIONS] USER[:GROUP] FILENAME(s)
    Here, 
    USER is the user name or the user ID (UID) of the new owner.Numeric user IDs is prefixed with the + symbol. 
    GROUP is the name of the new group or the group ID (GID). FILENAME(s) is the name of one or more files, directories or links.
      • Rules for chown

    USER – If only the user is specified in a file, the specified user will become the owner of the given files, the group ownership is not changed.
    USER: – When the username is followed by a colon (:) symbol in a file, and the group name is not given, the user will become the owner of the files, and the files group ownership is changed to user’s login group.
    USER:GROUP – If both the user and the group are specified (with no space betwen them), the user ownership of the files is changed to the given user and the group ownership is changed to the given group.
    :GROUP – If the User is omitted and the group is prefixed with a colon (:), only the group ownership of the files is changed to the given group.
    : If only a colon : is given, without specifying the user and the group, no change is made.
    (By default, on success, chown doesn’t produce any output and returns zero.)

    Example
      • To change both the owner and the group owner of a file with single user name (say dummy) – $ chown dummy:dummy example.txt (press enter) 
    • chroot

    Definition
    Syntax
    Example
    • chsh

    Definition
    Syntax
    Example
    • clear

    Definition
      • Used to removes the previous screen contents and the cursor remains at the top of the screen after the system prompt.
    Syntax
      • $ clear (press enter)
    • clear screen

    Definition
      • Used to removes the previous screen contents and the cursor remains at the bottom of the screen .
      • Applicable in few versions of Unix/Linux.
    Syntax
      • $ clear screen (press enter)
    • cmp

    Definition
      • This command compares two files contents byte-by-byte.
    Syntax
      • $ cmp firstfilename secondfilename
    Example
      • $ cmp file1 file2 (press enter)
    • compress

    Definition
    Syntax
    Example
    • cp (Copy)

    Definition
        • It is used to make copy of an existing file.
    Syntax
        • $ cp source_filename destination_filename (press enter)
    Example
        • $ cp file1 file2 (press enter)
    [copy the contents of file1 into file2 in the current directory]
        • $ cp file1 /usr/dummy/prg/file2 (press enter)

    [copy the contents of file1 into file2 in another directory (prg)]

    • cut 

    Definition
        • Used to cut/extract desired number of characters from the specified file.
    Syntax

    $ cut -c list filename (press enter) [ Here, -c helps to cut the character and list tells from which position to which position.]

    Example
        • Suppose a file name ‘dummy’ contains 4 lines data as –                   Temporary                                                                                           Public                                                                                                   Reverse                                                                                                 Anil                                                                                                 Now –                                                                                                                 $ cut -c 1 dummy (press enter)
    Output :(cut single char. from each line)
    T
    P
    R
    A

     $ cut -c 1 -4 dummy (press enter)

    Output :(starts cutting char. from first to fourth from each line)
    Temp
    Publ
    Reve
    Anil

     $ cut -c 2- dummy (press enter)

    Output :(starts cutting char. from second till the end from each line char. from each line)
     emporary                                                             ublic                                                                       everse                                                                   nil   

    D

    • date

    Definition
      • This command displays the system date & time as set by the system administrator.
      • The date command doesn’t prompt us to change either date or time.This is done by system administrator mainly.
    Syntax

    $ date (press enter)

    Example

    $ date (press enter)

    Output : Tue Nov 19 21:37:51 CST/IST 2010

    • dc

    Definition
    Syntax

    Example

    • df

    Definition
      • The df command is used to display the size, used space, and available space on the mounted file systems of our computer.
      • The two most useful options linked with df are  -h (human readable) and -x (exclude) options.
      • Here, the human-readable option displays the sizes in Mb or Gb instead of in bytes.
      • The exclude option allows df command to discount file systems we are not interested in. 
    Syntax

    $ df -h -x filesystem_drivename (press enter)

    Example

    $ df -h -x dummyfs (press enter) [dummyfs is the name of mounted filesystem of the system]

    • dir

    Definition
      • This command lists the contents of current directory.
      • It is similar as ls command.
    Syntax

    $ dir (press enter)

    • dump

    Definition
    Syntax
    Example

    E

    • echo

       Definition
      • Used to print/display string message or variable or expression value in the form of output.
       Syntax
      • $ echo string_message/’string_message’/”string_message” (Press Enter)
      • $ echo variable (Press Enter)
      • $ echo expression (Press Enter)
       Example
      • $ echo codershelpline (Press Enter)
      • $ echo ‘codershelpline’ (Press Enter)
      • $ echo “codershelpline” (Press Enter)
      • $ echo codershelpline is          our         site (Press Enter)
    Output : codershelpline is our site [No space in output]
      • $ echo “codershelpline is          our         site” (Press Enter)
    Output : codershelpline is          our         site
        • $ x=10 (Press Enter)
        • echo x (Press Enter)
        • $ x=10 (Press Enter)
        • $ echo `expr $x+1 (Press Enter)
      • exit

      Definition
          • Used to come out from the Unix/Linux System.
      Syntax
          • $ exit (Press Enter)
      Example
          • $ exit (Press Enter)
      • expr

      Definition
        • expr command is used to calculate an arithmetic expression mainly in a shell programming work.
        • They are often used with command substitution to assign a variable.
        • This command is also used in incrementing the value of a variable. eg- 
      Syntax

      Example

        F

        • find

        Definition
        Syntax
        Example
        • finger

        Definition
          • This command gives a short information about a user, such as the time of the user’s last login, the user’s home directory, the user account’s full name, mailing details etc.
        Syntax
          • $ finger username (Press Enter)
        Example
          • $ finger dummy (Press Enter)

        G

        • grep

        Definition
          • The grep command searches the given pattern of contents from lines of contents.
          • The grep command can also search the contents of files in the current directory.
          • The output lists the name of the file and shows the lines that matched the contents.
          • The matching text is highlighted in the lines of files.
        Syntax
          • $ grep searched contetns/pattern filename (Press Enter)
        Example
          • $ grep computer abc.txt (Press Enter) [Searched the term computer from abc .txt files]
          • $ grep computer *.txt (Press Enter) [Searched the term computer from all .txt files]
        • gzip

        Definition
        Syntax
        Example

        H

        • halt

        Definition
        Syntax
        Example
        • head

        Definition
          • Display the first few lines (usually 10)/characters of a file to the screen.
        Syntax
          • $ head filename (Press Enter) 
        Example
          • $ head file1.txt (Press Enter)       [ By default, to display the first 10 lines of a file to the screen.]
          • $ head -n 2 file1.txt (Press Enter)       [ To display the first 2 lines of a file to the screen.]
          • $ head -c 20 file1.txt (Press Enter)       [ To display the first 20 characters/bytes of a file to the screen.]
          • help

          Definition
          Syntax
          Example
          • history

          Definition
            • The history command lists the commands we have previously used on the command line.
            • We can repeat/use any of the history lists commands again by typing an exclamation symbol (!) with the index number of the command from the history list. for example – !52
            • To repeats the previous command again two exclamation symbol is used such as !!.
          Syntax
            • $ history (Press Enter)
          Example

          I

          • id

          Definition
          Syntax
          Example

          J

          K

          • kill

          Definition
            • The kill command is used to terminates a running process by giving process ID (PID) of that process. 
            • This command also tells the Unix/Linux to kill the lines written on $ prompt i.e. it ignores everything on the line on Unix/Linux prompt.
          Syntax
            • $ kill process_Id (Press Enter)
          Example
            • $ kill 1240 (Press Enter)

          L

          • last

          Definition
          Syntax
          Example
          • less

          Definition
            • To see the contents of a larger file on the screen pagewise.
            • To move/scroll page forward and backward we can use Up or Down Arrow keys  or PgUp or PgDn keys, or the Home,Space or End keys.
            • To come out from ‘less ‘ option,  press  ‘q’ button to quit from less option.
          Syntax
            • $ less filename (Press Enter)
          Example
            • $ less file1.txt (Press Enter)
              • let

              Definition
              Syntax
              Example
              • ls

              Definition
                • This command displays all the stored and saved working directory contents i.e. all files except hidden files in the current working directory alphabetically in which first file name is in uppercase letters in multiple columns. 
                • The output of ls is always sorted in some specific order, default is alphabetical.
                • The ls command exists in several form with different options –
                  1. ls-x (displays all the stored and saved files or directories from the current working directory, arranged horizontally width wise from left to right on each line)
                  2. ls-s (displays all the stored and saved files or directories from the current working directory, arranged size in disk block for each entry and total for all entries on each line)
                  3. ls-c (displays all the stored and saved files or directories from the current working directory, arranged horizontally width wise from left to right but sorts each column in descending order column wise)
                  4. ls-m (displays all the stored and saved files or directories from the current working directory, arranged horizontally width wise from left to right on each line and each file name is separated by comma from next file)
                  5. ls-l (displays all the stored and saved files or directories from the current working directory, with certain associated information of each file such as modes, permission, GID [group identification number] number, GID name, UID [User identification number], size, month, date, time, file name etc. All these information are represented in symbolic form i.e. the first character of first column represent mode/type of file i.e. if the first letter is d- denotes directory, – symbol denotes ordinary file, b&c denotes device, next nine consecutive letters for file access permission)
                  6. ls-r (Used to display file name and directory within the current working directory without date and time information in reverse order. The name with slash(/) symbol denotes directory name while others are ordinary files)
                  7. ls-p (Used to display file name and directory within the current working directory in ascending order. The name with slash(/) symbol denotes directory name while others are ordinary files)
                  8. ls-n (works similar as ls-l option except owner and group name in place of UID and GID)
                  9. ls-wild character[*/?] (used to search files from current working directory. For example – $ ls dummy* (press enter) or $ ls dummy? (press enter)
                  10. ls-a (Used to display all files including hidden files. Hidden files are started with . symbol)
                  11. ls-f (Used to display all  executable files (.exe) started with * symbol attached ahead to it with the list.)
                  12. ls-m (Used to display the directory,  sub-directory and file contents in very compact form separated by comma.)
                  13. ls directory_name (Used to display the contents of given directory eg- $ ls /usr/dummy (press enter))
              Syntax
                • $ ls (press enter)
                • $ ls  path of directory (press enter)
              Example
                • $ ls (press enter)
                • $ ls /home/system/dir1 (press enter)

              M

              • mail

              Definition
              • Used to send message to other users who are connected to the network and are present/will come on other terminal. The coming user got the message when he/she logged in as an informative statement-There is a mail.
              • To read the mail message, user can type mail on $ prompt.
              Syntax
              $ mail UID (press enter)
              type the message
              ctrl+d – to come out from message typing.
              Example

              • man (Manual/Help)

              Definition
                • To take help or see/know the more details (help) about any commands used in Unix/Linux.
              Syntax
                • $ man commandname (Press Enter)
              Syntax
                • $ man wc (Press Enter)
                • $ man ls (Press Enter)
                • $ man man (Press Enter)
              • md

              Definition
              Syntax
              Example
              • mkdir

              Definition
                • Used to create a new fresh/blank directory/sub-directory into current directory where we are working/present now. 
              Syntax
                • $ mkdir direcotry/sub-directory name (Press Enter)
              Example
                • $ mkdir Dir1 (Press Enter)
                • $ ls (Press Enter)                   [To see the created new directory]
              • more

              Definition
              Syntax
              Example
              • mv (Move)

              Definition

              It performs following functions –

              (i) Used to rename the saved/existing file or directory in the current working directory.

              Syntax : $ mv  oldfilename  newfilename (unique)     [Press Enter]
              Example : $ mv  file1  file2     [Press Enter]
                                  $ ls     [Press Enter]  (To see the renamed file)

              (ii) Used to move/cut a file from their existing location/directory and is ready to paste at given new location/directory.

              Syntax : $ mv  filename  path_of_new_location     [Press Enter]
              Example : $ mv  file1  /usr/dummy     [Press Enter]             (Moves file1 into new dummy directory)

              N

              • netstat

              Definition
              Syntax
              Example

              O

              P

              • passwd

              Definition
                • This command is used to change/modify the old password with new one of the user who logged currently in to the terminal.
              Syntax

              $ passwd (press enter and follow the instructions to change)

              Example

              • ping

              Definition
              Syntax
              Example
              • ps (process status)

              Definition
                • Gives information about the currently running process/task.
              Syntax
                • $ ps (press enter)
              Example

              • pwd (Print Working Directory)

              Definition
                  • It displays the full/complete/absolute path details of current working directory.
                  • It does not take any argument/option.
              Syntax
                  • $ command_name (press enter)
              Example
                  • $ pwd (press enter)
                  • Output = /ramdisk/home/knoppix
                  • Here first / = root directory, home = parent or group directory, knoppix = working or current or home directory.

              Q

              R

              • rename

              Definition
              Syntax
              Example
              • rm (Remove)

              Definition
                  • Used to remove/delete a file from a current working directory.
              Syntax
                  • $ rm filename (Press Enter)
              Example
                  • $ rm file1 (Press Enter)
                  • [Removes file1 from current working directory]
                  • $ rm /usr/dummy/prg/file1 (Press Enter)
                  • [Removes file1 from another directory(prg)]
              • rmdir (Remove Directory)

              Definition
                  • Used to delete/remove an empty directory/sub-directory, not file.
              Syntax
                  • $ rmdir directory_name (Press Enter)
              Example
                  • $ rmdir dir1 (Press Enter)

                  S

                  • shutdown

                  Definition
                  Syntax
                  Example
                  • sort

                  Definition
                  Syntax
                  Example
                  • ssh

                  Definition
                  Syntax
                  Example
                  • stty

                  Definition
                    • This command enables us to see the previous erasing character by kill command. It also allows us to change them.
                    • This command also allows us to examine and alter many other terminal settings as well.

                  Syntax

                  Example

                  T

                  • tar

                  Definition
                  Syntax
                  Example
                  • tail

                  Definition
                    • Display the last few lines, usually 10 lines/characters of a file to the screen.
                  Syntax
                    • $ tail filename (Press Enter) 
                  Example
                    • $ tail file1.txt (Press Enter)       [ By default, to display the last 10 lines of a file to the screen.]
                    • $ tail -n 2 file1.txt (Press Enter)       [ To display the last 2 lines of a file to the screen.]
                    • $ tail -c 20 file1.txt (Press Enter)       [ To display the last 20 characters/bytes of a file to the screen.]
                  • time

                  Definition
                  Syntax
                  Example

                  U

                  • uname

                  Definition
                  Syntax
                  Example
                  • users

                  Definition
                  Syntax
                  Example

                  V

                  • vi

                     Definition
                    • It is a popular Editor of Linux/Unix  in which a user can create a new large file mainly for programming purpose or edit a created/existing file or to search a particular string.
                    • vi editor works in two mode- append/insert mode and edit mode.
                     Syntax
                    • $ vi file name (Press Enter)
                     Example
                    • $ vi abc.sh (Press Enter)

                  W

                  • w

                  Definition
                    • The ‘w’ command lists the currently logged in users to that network.
                  Example
                    • $ w (press enter)
                  • wall

                  Definition
                  Syntax
                  Example
                  • wc

                  Definition
                    • This command gives the number of lines, words and characters present in a file respectively.
                  Syntax
                    • $ wc filename (Press Enter)
                  Example
                    • $ wc file1 (Press Enter)
                  •            Output : 10 23 54 file1 (lines – 10, words – 23, characters – 54)
                  •  
                    • $ wc – 1 file1 (Press Enter)
                      • Output : 10  file1 (lines  – 10) Display only the total no. of lines in a file.
                    • $ wc -w file1 (Press Enter)
                      • Output : 23  file1 (words – 23) Display only the total no. of words in a file.
                    • $ wc -c file1 (Press Enter)
                      • Output : 54 file1 (characters – 54) Display only the total no. of characters in a file.
                  • wget

                  Definition
                  Syntax
                  Example
                  • who

                  Definition
                    • Displays the total no. of currently logged in user id in Linux environment along with terminal name the user working on, date & month, login time etc.
                  Syntax

                  $ who (press enter)

                  Example
                    • $ who -b (press enter) [Used to find the date the machine was started/booted.]
                    • $ who -q (press enter)[Used to find how many users are currently logged in this system/environment.]
                  • whoami

                  Definition
                    • Displays the currently logged in (myself) single user id only in Linux environment along with terminal name the user working on, date & month, login time etc.
                  Syntax
                    • $ who am I (press enter)
                  • whoareyou/whoitwas

                  Definition
                    • Functional in some versions of Linux/Unix.
                    • Similar as whoami command but sounds much more intelligent.
                  Syntax
                    • $ who am I (press enter)
                  • write

                  Definition
                  Syntax
                  Example

                  X

                  Y

                  Z

                  • zip

                  Definition
                  Syntax
                  Example

                   1,225 total views,  4 views today

                  Categories: Unix/Linux OS

                  0 Comments

                  Leave a Reply

                  Your email address will not be published. Required fields are marked *

                  This site uses Akismet to reduce spam. Learn how your comment data is processed.