ls - list the contents of the current directorypwd - print the present working directory - tells you where you are currently. The format is something like /home/myID - just like on most computer systems, this represents leaves on the tree of the file system structure, also called a "path".cd <whereto> - change the present working directory to <whereto> You will need to provide a path like /work/myID to change to that directory.<wheretos>: .. (period, period) means "up one level". . means current directory. ~ (tilde) means "my home directory". ~myfriend (tilde "myfriend) means "myfriend's home directory".nano - The text editor we'll be usingdf shows you the top level of the directory structure of the system you're working on, along with how much disk space is availablehead <file> and tail <file> shows you the top or bottom 10 lines of a file <file>more <file> and less <file> both display the contents of <file> in nice ways. Read the bit above about man to figure out how to navigate and search when using lessfile <file> tells you what kind of file <file> is.cat <file> outputs all the contents of <file> - CAUTION - only use on small files.rm <file> deletes a file. This is permanent - not a "trash can" deletion.cp <source> <destination> copies the file source to the location and/or file name destination}. Using . (period) means "here, with the same name". cp -r <dirname> <destination> will recursively copy the directory dirname and all its contents to the directory destination.scp <user>@<host>:<source> <destination> works just like cp but copies source from the user user's directory on remote machine host to the local file destinationmkdir <dirname> and rmdir <dirname> make and remove the directory "dirname". This only removes empty directories - "rm -r <dirname>" will remove everything.wget <url> fetches a file with a valid URL. It's not that common but we'll use wget to pull data from one of TACC's web-based storage devices.The shell has shorthand to refer to groups of files by allowing wildcards in file names. * (asterisk) is the most common; it is a wildcard meaning "any length of any characters". Other useful ones are []to allow for any character in the set <characters>>
For example: ls *.bam lists all files in the current directory that end in .bam
Three special file names:
. (single period) means "this directory". So ls -l . means "list contents of this current directory".. (two periods) means "directory above current." So ls -l .. means "list contents of the parent directory."ls -l ~ means "list contents of the my home directory."The concept of PATH
On a unix command line, you can only access files that are in your current working directory. If you are in /scratch/01184/daras/ and you issue the command:
less genomeFile
this will work only if genomeFile is located in /scratch/01184/daras/.
To access files outside your current directory, you can provide the absolute path or relative path to find the file. If genomeFile is actually located in /scratch/01184/daras/data, then you can open it by using one of these two commands:
less /scratch/01184/daras/data/genomeFile
(or)
less data/genomeFile
Exception: If the location of a file, most often, an executable is included in your shell environment variable called PATH, you can run it from anywhere without specifying where it is.
echo $PATH to see what is in your PATH.
Always use tab to complete file names. If the file is in the current directory or is in your PATH, tab will do auto complete.
Always remember where you are, on a Unix environment!
So many options...
When running scripts and software tools, all the inputs you provide to it are called arguments or parameters or options. Each tool/script can be a little different in how it takes its arguments. But typically, they follow a structure.
command <options> inputfile > outputfile
command -option1 value1 -option2 value2 -option3 inputfile > outputfile
Example: blastp -query scaffolds.fasta -db TAIR10_pep_20101214 -eval 0.0001 -outfmt 6 -out blastp.out
If you need to find out the options for a command, try any of these (again each tool is different):
.bash_profile, .profile files
A startup script that gets executed every time a session is started interactively. You can put any command in that file that you could type at the command prompt. Put commands here to set up your particular environment, and to customize things to your preferences (such as paths, aliases, modules to load).
File Editors
As we will be using nano throughout the class, it is a good idea to review some of the basics. nano is a very simple editor available on most Linux systems. If you are able to use ssh, you can use nano. To invoke it, just type:
nano (or)
nano <filename>
You'll see a short menu of operations at the bottom of the terminal window. The most important are:
Be careful with long lines – sometimes nano will split long lines into more than one line, which can cause problems in our commands files.
Naming Files
Try to find a convention and stick to it when naming files and directories. But, most importantly:
BACK TO THE COURSE OUTLINE