commandName arg1 arg2ssh stands for SecureSHell.<username>@<server>> ssh -p 22 jmonlong@www.genome.med.kyoto-u.ac.jp
Exercise: Connect to the server (using your username).
> ls
> echo Hello
> man echo
ls LiSt the files in the current directory.man open the MANual of a command. Useful to find details on arguments. Quit by pressing q.clear or Ctrl-L clear the screen.At any moment you are in a directory, the working directory.
pwd to Print the Wordking Directory.cd to Change Directory.
.. represents the previous directory./ is the directory separator.~ represents your root folder.> pwd
/home/jmonlong
> ls
workshop
> cd workshop
> pwd
/home/jmonlong/workshop
> cd ..
> cd workshop/linux
workshop.workshop folder.linux.
Note: mkdir to MaKe a DIRectory.
> pwd
> mkdir workshop
> cd workshop
> mkdir linux
> cd ..
rm ReMove a file.cp CoPy a file.mv MoVe a file.> cp file1 file2
> rm file1
> mv file2 file3
linux folder.linux folder.gencode.gtf (using mv command)
Note: To download the file you can use:
> wget https://goo.gl/FLGAZH
> wget https://goo.gl/FLGAZH
> cp FLGAZH workshop/linux
> rm FLGAZH
> cd workshop/linux
> mv FLGAZH gencode.gtf
head/tail print the first/last lines of a file.cat print the entire file.less to explore the text file.nano is a text editor. To open, change and save a file.grep retrieves lines containing a word or expression.wc retrieves the Word Count as well as the number of lines in a file.less. Try using -S argument.> cd ~/workshop/linux
> head gencode.gtf
> less gencode.gtf
> less -S gencode.gtf
> wc gencode.gtf
> grep ENSG00000278267 gencode.gtf
gzip to compress a file.gunzip to decompress a .gz file.zless/zcat/zgrep are less/cat/grep directly on gzip files.tar -xzvf file.tar.gz to decompress and extract a .tar.gz file.> gzip gencode.gtf
> zgrep ENSG00000278267 gencode.gtf.gz
> gunzip gencode.gtf.gz
> tar -xzvf archive.tar.gz
|.> zcat gencode.gtf.gz | grep ENSG00000278267
> zcat gencode.gtf.gz | grep ENSG00000278267 | head
> zcat gencode.gtf.gz | grep ENSG00000278267 | less
> to redirect it to a file.> gunzip -c gencode.gtf.gz > gencode.gtf
> ls -lh
> zcat gencode.gtf.gz | grep ENSG00000278267 | head > gene1.gtf
scp command<username>@<server>:<pathToFile>
scp jmonlong@www.genome.med.kyoto-u.ac.jp:workshop/linux/gene1.gtf .
* wildcard* represent any possible character sequence.> ls
analysis.sh graphs.R results.csv samp1.bam samp1.pdf temp1.log temp1.txt temp.txt.gz
> ls temp*
temp1.log temp1.txt temp.txt.gz
> rm temp*
> ls
analysis.sh graphs.R results.csv samp1.bam samp1.pdf
Caution: rm * removes every files.
.sh file.sh.> sh myScript.sh