Unix Basics:
Common Commands

Note: You need to know all of this material for exams.


Conventions:


man   # The on-line manual with a complete list of options available for each command.


pwd   # Print working directory: tells absolute path from root to where you currently are in the file system.


cd   # Change directory.


mkdir   # Make directory.


rmdir   # Remove directory. (Note: The directory must be empty to be removed.)


ls   # List files in the current directory in a column format, with "/" after directories, and "*" after executable files.


cp   # Copies a file, with name either absolute or relative.


rm   # Removes a file, but not a directory


mv   # moves a file. This can be a dangerous command if you make typo!


more   # Lists the contents of a file and pauses at each screenful.


cat   #  Concatenates files and prints to the screen.


script   # Records all interactions in a window and saves in a file.


history   #  Lists previous commands by number.


Ctrl-c   # Emergency stop for a process.


Ctrl-d   # End of file.


Sample Interactive Session (on Linux):


Redirection of input and output: At the command line, Unix allows redirection operators: < , > , and >>


Pipes on the command line: Two commands can be connected with a "pipe" by putting | between them:
Copyright © 2011, Neal R. Wagner, Permission is granted to access, download, share, and distribute, as long as this notice remains.