Learning to be a Unix Ninja from our very own Sensei:
Dr. Julian Catchen
University of Oregon
So today’s session was all about getting comfortable on the command line and learning how to bash around a bit, manipulating files, moving through file systems developing the unix cunning which will work wonders for bioinformatic analysis in the future…though in the here and now it’s probably quite maddening and overwhelming.
- By the end of these two weeks he plans to make us Unix/Linux converts
- We googled ‘unix commands’ to obtain a cheat sheet of commands to help us if we forget.
- By the end of this session you should know about the following, if not, go back to his slides and the Unix Tutorial
- change directories
- list files, list all files, list files that humans can read
- move up and down commands on the command line
- create directories
- know what relative vs. absolute paths are
- know how to figure out where you are
- know three ways to ‘get home’ from anywhere on the computer system
- know what tab and tab tab do and why they are totally cool
- more, head, tail and cat
- know how to unzip and de-tar files or do both at once
- what is grep?
- how to obtain line counts in a file
Here are the highlights!
- Unix was originally developed by AT&T!
- Steve Jobs was fired from Apple, developed Nextstep, Apple went into the tubes, re-hired Steve Jobs–Steve Jobs promptly threw their operating system out and applied Nextstep which because OSX (it’s Unix based).
- Google Android runs Linux
- Again, do check out the webpage Unix Tutorial which has a run down of all the specific commands and how to use them when navigating file structures, creating directories and files, copying, viewing, contatenating, moving, deleting as well as a review of the commands we used tonight to cut, search, count and manipulate text sequence files.
- Also check out Lisa Johnson Cohen, one of our attendees, she has a great lab notebook with a run down of the powerpoint exercises you did in class tonight along with some pretty fetching pictures!
Live free or die: Unix! (on a license plate)
Computational biology is the art of learning Unix
- If you can operate Unix well you can do anything, cure world hunger, advance world peace…ok maybe not but you could sure code like a maniac!
Commit yourself to the command prompt
- Unix history is fantastically complicated
- Lots of Unixes extinct
Today and tomorrow are just the beginning, not the end
- There are two types of people: White with black text and Black with green text
- Cheat sheets are awesome
- Everything in Unix is a hierarchy
- Bin = binary
- Key concept is paths
- Names do not make objects unique, paths do
- mkdir = make directory
Type everything avoid your mouse at all costs!
- Relative paths: Given from “here” and are shorter easier to write but you have to remember and understand where here is
- . = here
- .. = one level above where you currently are
Follow the bouncing stick man… Where are you in your file system?
- Foobar (Don’t ask why…it’s a computer scientist thing, in this case the less you know the better!)
- All those little commands you type to help navigate files and file systems are actually little programs themselves. For example: ‘ls’ is a program developed in the 1970s
If you are typing you are doing it wrong, Unix people don’t like to type
- Use the tab for completion
- Up arrow gives you history
- Type “history” copy paste a previous command
- Ways to view text files
- Keyboard maps: Are absolute MAYHEM!!! We’ll attempt to hopefully sort the chaos tomorrow!
Actual student Quote: “What I wouldn’t give the type a Tilde or @ sign right now!”
- Ctrl V + tab
Here are the commands and terms we covered tonight…do you remember what they all mean?
Remember you can always type man followed by the command to learn more about the specific commands as well as all the options or ‘flags’ that you can set to help get the command to do what you want…
- This will give you information on all the flags/options you can use with the word count command, like ‘-l’ which means count all the lines in the file…well gee that sounds useful!