Resources > mini tips how to > page1 > page2 > page3

  • Recursive touch
    Touch a bunch of directories recursively. All the directories and their contents (To re-stamp time on all files)

                $ find DIR | xargs touch

  • Redirecting Standard Error
    Redirecting errors when compiling,the number 2 represents the standard error output stream,
    1 represent standard output.

                $ make  > output.txt 2>&1

  • Command Substitution
    To use command substitution, enclose any command that generates output to standard output
    inside parentheses and precede the opening parenthesis with a dollar sign, $(command).
    It is handy for using the output of one command as an argument to another command.

                $ rpm -ql $(rpm -qa | grep httpd)

  • Using for Loops from the Command Line
    For small loops it can be a great time saver. Example: A simple loop to make a
    backup copy of all the files in a directory:

              $ for file in * ; do cp $file $file.bak; done

<< Previous---|---Next >>

 
   
  9 Ben Zion Galis Street, Petach Tikva, Israel 49277 Tel: +972-3-9302382 Fax: +972-3-9302383 Mail:info@trego.co.il