Monday, May 7, 2012

Unix Commands

Standard Commands

  1. Displaying the Date and Time: The date command
  2. Finding Out Who's Logged In: The who command
  3. Echoing Characters: The echo command - echo args
  4. List Information About Active Processes: The ps Command
  5. Display Current Working Directory Path: The pwd Command
  6. Sort Lines of file(s) or standard input if not supplied. - sort file(s)
  7. Count the Number of Lines Words and Characters in Files(s) or Standard Input if not Supplied - wc file(s)
  8. Returns Your Username: The whoami Command
  9. Lets you Change Your Password: The passwd Command
  10. Shows the Disk Usage of the Files and Directories in Filename - du filename
  11. Find Files Anywhere on the System - ff
  12. Looks for the String in the Files -  grep string filename(s) 
  13. Kills (ends) the Processes With the ID you Gave -  kill PID 
  14. Lists Your Last Logins -  last yourusername
  15. Tells you who's logged in, and what they're doing - w  
  16. Gives you lots of information about that user, e.g. when they last read their mail and whether they're logged in -  finger username
  17. Lets You Have a (typed) Conversation with Another User -  talk username
  18. Lets You Exchange One-line Messages with Another User - write username
  19. Lets you Send E-mail Messages to People Around the World. It's not the only mailer you can use, but the one we recommend - elm

Working With Files

  1. Listing Files: The ls Command - ls files
  2. Displaying the Contents of a File:The cat Command - cat file(s)
  3. Counting the Number of Words in a File: The wc Command
  4. Making a Copy of a File: The cp Command - cp file1 file2
  5. Renaming a File: The mv Command - mv file1 to file2
  6. Removing a File: The rm Command - rm file(s)
  7. Links two Files Together - ln file1 to file2
  8. Compares Files, and Shows Where They Differ - diff filename1 filename2
  9. Lets you Change the Read, Write, and Execute Permissions on Your Files -  chmod options filename 

Working With Directories

  1. Displaying Your Working Directory: The pwd Command
  2. Changing Directories: The cd Command - cd dir
  3. Creating a Directory: The mkdir Command - mkdir dir(s)
  4. Linking Files Into Directories: The ln Command - ln file(s) dir
  5. Copying a File from One Directory to Another: - cp file(s) dir
  6. Moving Files between Directories: mv old file/first directory new file/second Directory - mv file(s) dir
  7. Removing a Directory: The rmdir Command - rmdir dir(s)
  8. List Files in Directories or in Current Directory if Directories is not Specified. - ls dir(s)

Connecting to the Outside World:

  1. Allows you to Read News - nn
  2. Lets you Connect to a Remote Host - rlogin hostname
  3. Also Lets you Connect to a Remote Host - telnet hostname
  4. Lets you Download Files From a Remote Host Which is Set up as an Ftp-Server - ftp hostname
  5. Lets you Browse the Web From an Ordinary Terminal - lynx

File Compression:


  1. Compresses Files, so That They Take up Much Less Space - gzip filename
  2. Uncompresses Files Compressed by gzip - gunzip filename
  3. Lets you Look at a gzipped File Without Actually Having to gunzip it (same as gunzip -c) - gzcat filename
  4. You can even print it directly, using  - gzcat filename | lpr

No comments:

Post a Comment