Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Unix Command Cheat Sheet

...

  1. . (single period) means "this directory".  So ls -l . means "list contents of this current directory"
  2. .. (two periods) means "directory above current." So ls -l .. means "list contents of the parent directory."
  3.  ~ (tilde) means "my home directory". So 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 /home/dhivya/dinner data and you issue the command: 

less lunchMenugenomeFile

this will work only if lunchMenu genomeFile is located in /home/dhivya/dinnerdata.

To access files outside your current directory, you can provide the absolute path or relative path to find the file.  If lunchMenu is genomeFile is actually located in  /home/dhivya/lunchreferences, then you can open it by using one of these two commands:

less /home/dhivya/lunchreferences/lunchMenugenomeFile

(or)

less ../lunchreferences/lunchMenugenomeFile

Exception: If the location of a file, most often, an executable is included in your shell enviornment 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 enviornmentenvironment!

 

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.

...

.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).

 

BACK TO THE COURSE OUTLINE

...