UNIX commands
Some UNIX commands that you will benefit from knowing include:
- pwd -- print working directory
- cd -- change directory
- ls -- list directory contents
- . -- a reference to the current working directory
- .. -- a reference to the parent of the current working directory
- ~ -- a reference to the user's home directory
- nano -- a text editor that can appear in the terminal itself
- gedit -- a text editor that appears in its own window
- cp -- copy a file
- mv -- move a file
- rm -- remove a file
- mkdir -- make a directory
- rmdir -- remove a directory
- * -- glob (like a wildcard; we will study this more as the course progresses)
- man -- manual pages (help pages); please note that you type a colon and then the letter q to quit, i.e., you type :q
- cat -- list the contents of one or more files (stands for concatenate, because we basically concatenate files together with this command)
- sort -- just what it says, namely, it sorts data, by default, in alphabetical order, but can be numerical order with -n
- uniq -- extracts unique items from a list that has already been sorted
- wc -- word count; prints the number of lines, number of words, and number of bytes in a file
- grep -- search for a pattern
- head -- display the first 10 lines of a file
- tail -- display the last 10 lines of a file
- | -- pipe the output of one command into the input of another command
- history -- display recently typed lines
- chmod -- change permissions; commonly used permissions are chmod 644 if others should read a file (and you can write to the file), or chmod 755 if others should execute the file (and you can write to the file)
- cut -- extract fields from every line of data with a common delimiter (e.g., from comma-separated data)
- diff -- find the differences in two files
- zip -- zip the contents of a file or directory into a zip file
- ssh -- secure shell connection
- sftp -- secure file transfer protocol
- scp -- securely copy files