Results 1 to 2 of 2

Thread: Unix command meanings

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Contributing Member
    Join Date
    Nov 2007
    Answers
    88

    Unix command meanings

    What is the meaning of these commands in Unix :

    unset VAR
    man ls | grep time
    ls -lR | grep dvi

    Any body can explain the above Unix statements


  2. #2
    Expert Member
    Join Date
    Jan 2008
    Answers
    133

    Re: Unix command meanings

    1> unset VAR
    VAR is an environmental variable containing some value, which has been set up in this example. Using this command, "unset VAR", the variable will unloaded from the environmental list of variables and will therefore loose the value. It will not available for further reference after the command has been issued.

    2> man ls | grep time
    this composite command can be split up into 3 parts,
    1> man ls - man will list the manual page for the command "ls"
    2> | ( pipe symbol ) - Usage of this pipe symbol will redirect the output of "man ls" command to the next command which is "grep time".
    3> grep time - grep (global regular expression print) will search for the particular string "time" in the output of "man ls".

    Pipe symbol connects the output of the first command with the 2nd, thereby in this example, the composite command searches for the string time in the manual page of command "ls".

    3> ls -lR | grep dvi
    3 parts again 1> ls -lR -> list the contents of the current directory and its subdirectories ( R option ) using the long listing format ( l option ).
    2> | - connect 1st and 2nd
    3> grep dvi - search for "dvi" string
    Effectively, this means search for the file named dvi in the current directory and its sub-directories.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact