Linux (Unix) Commands

Linux (Unix) Commands

<p>More Linux (Unix) Commands cat - concatenate  cat [options] [files] more - display the named files on a terminal, one screenful at a time  more [options] [files]Display the named files on a terminal, one screenful at a time. clear – clear screen wc – print byte, word, and line count for each file  wc [options] [files] o –c bytes o –l lines o –w words diff – find the difference between two files  fileName1 fileName2 grep – search one or more files for lines that match a regular expression pattern  grep [options] pattern files o –i ignore case ps – report on active processes  ps [options] o –ef select all processes, full listing date – display current date and time  date [options] echo – display a line of text  echo [string] whoami – displays your user name</p><p>File I/O (input/output)</p><p> To ‘pipe’ the output of command1 to the input of command2 use the | character (piping information from one process (output) to another (input) o grep -i hp ~info/machines | wc -l o grep -i dell ~info/machines | wc -l o ps -ef | more  Redirect the output of a command to another new file o Use the > character to redirect the output of a command to a new file o cat public_html/index.html > newfile  Appending to a file o Use the >> to append the output of a command to an existing file o cat public_html/index.html >> newfile Short cuts  arrow keys  tab</p><p>Shell scripts  a series of commands in a file that can be executed by a shell command line interpreter  To create a shell script o gedit script1 & . Type commands you want to execute  date  echo “my system has this many active processes”  ps –ef | wc –l . Save file o Ensure script1 file has execute permission bits set . i.e. chmod 755 script1 o Execute shell script . script1</p>

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    2 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us