Practical Computing for Biologists: Chapters 1, 4, 5, Appendix 3.
Unix Basics from UConn CBC: http://bioinformatics.uconn.edu/unix-basics/
Software Carpentry Shell Novice lesson: Episodes 1-4: https://swcarpentry.github.io/shell-novice/
Command | Function |
---|---|
pwd |
Print Working Directory |
cd |
Change Directoy (cd , cd - , cd ~/<directory> , cd .. ) |
ls |
List files (ls -F , ls --help ) |
man |
Manual page for a command |
mkdir |
Make a new directory |
emacs |
A rudimentary command-line text editor |
rm |
Delete file(s); use rm -r <directory> to delete directory and contents |
touch |
Create empty file |
cp |
Copy files and directories |
mv |
Move or rename files and directories |
wc |
Word Count (wc -l ) |
cat |
Print an entire file, or concatenate multiple files |
less |
Read a file, one page at a time |
sort |
Sort lines (sort -n , sort -r ) |
head |
Read beginning lines of a file (head -n # ) |
tail |
Read last few lines of a file (tail -n # ) |
*
wildcard to select multiple files in a directory, using the []
wildcard to select one or more letters, e.g. *[AB].txt
for file names ending
in A or B.|
).>
).Notes about reading these documents:
Sections highlighted in grey are shell input or “standard input” (stdin
).
Lines following it prefixed by '##'
denote shell output or “standard output” (stdout
):
x='Welcome to MEDS 5420'
echo $x
## Welcome to MEDS 5420
You will communicate with the operating system (OS) by typing commands into the terminal window. You can use the terminal window to:
Command Line is the most general and refers to typing commands directly into a terminal that can be executed by the computer.
Shell (sh) is specific program (language written by Steve Bourne while at Bell Labs) that processes commands and returns output.
Bash stands for Bourne Again Shell and is an updated version of the Shell language. This is the most popular Shell.
Terminal is a user interface that takes input and provides an output in text format; the interface runs the input through Shell or Bash to process the command.