-
Contributing Member
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
-
Expert Member
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
-
Forum Rules