Practical Assignment #1 for Intro to UNIX
This is Assignment should take 1-2 hours of steady work. Use the lecture notes web pages and other online sources of reference material.
- Open a terminal program, use ssh to login to the RCR's GCG server [mendel.med.nyu.edu]
- List the contents of your home directory with the ls command.
You won't see anything because there are no files in your directory yet.- Add a sequence to your directory with the fetch comand for a local GenBank sequence by accession number:
> fetch enzyme.datand for a protein directly from NCBI:> netfetch NP_000221- Look at the list of your directory contents now with the ls command
- Look at the listing again using the ls -l command option.
Note the additional information about file permissions, owner, group, file size, and date of creation.
- Change the file permissions on np_000221.rsf so that no one else can read it.
Use the chmod command to remove read permissions for group.chmod g-r np_000221.rsfNow re-check the permissions using ls -l
Now make the file executable for all users:chmod a+x np_000221.rsfand re-check the permissions using ls -l
- Now lets have a look at the contents of a sequence file. First use the cat command to write the contents to the screen.
cat np_000221.rsfThis is not so convenient since it dumps the entire contents of the file onto the screen at once. You can scroll back and forth using the buffer built into your telnet program, but this is a hassle for large files.
Try the same thing with the more command and view the file one screenfull at a time
(using the spacebar to advance, CTRL-U to go back).Read the annotation for this sequence file. What is this gene (description), how long is it (in amino acids), and what organism is it from? (save this info to send to me at the end of this exercise).
- Create a sub-directory in your home directory for these weekly exercises. Make up your own name, but keep it short since you will have to type it often. Many people use a capitol letter to identify directories. Use the mkdir command.
mkdir ClassworkCheck your file listing again with ls -l
Note that the new sub-directory has a "d" at the beginning of the code for file permissions where all other files just have a "-"
- Now copy your sequence files from your home directory into the new subdirectory with the cp command. Make use of the "*" wildcard to copy both files at once and to save yourself some typing.
cp *.* Classwork
- Move down into the sub-directory with the cd command, and check the files in there with ls . Check where you are with the pwd command.
- Delete the files with the rm command
[Note that you could type rm *.* but this is usually a BAD IDEA]rm *.gb* rm *.rsf- Return to your home directory. Note that the files are still there. This time, move them to the sub-directory with the mv command. Check the listings in your home directory and the sub-directory after the move. Send me an e-mail message (stuart.brown@med.nyu.edu) with a listing of files in your home directory and your Classwork directory (use the cd and ls commands to make this listing. Also include the info about np_000221.rsf from #7 above.
- Now try FTP.
Open an FTP program on your computer (Fetch for Macs, WS_FTP for Windows).
Connect to mendel.med.nyu.edu and use your username/password. You should see a listing of files and directories in your account.
Copy (GET) a file from the server onto your local computer and open it with a text editor (or word processing program).
- Now that you are feeling a little bit comfortable with UNIX, it is time to toally demoralize you. Have a look at the UNIX help system known as man pages.
Look at the help file for the chmod command by typing man chmod.
It is possible to extract some meaning from this, but it is certainly not the place for beginners to start. Check out these links to other online tuorials for UNIX:
(and bookmark the ones you like best on the computers where you will be doing your GCG work)
- UNIX for Beginners
http://www.ee.surrey.ac.uk/Teaching/Unix/
- Getting Started in UNIX
http://www.stanford.edu/group/dcg/leland-docs/unixgetstart.html
- Unix Guru Universe
http://www.ugu.com/sui/ugu/show?help.beginners
- Getting Started With The Unix Operating System
http://www.leeds.ac.uk/iss/documentation/beg/beg8/beg8.html
![]()
Using Computers for Molecular Biology
Stuart M. Brown, RCR, NYU Medical Center Comments to: browns02@med.nyu.edu