UnixCommands Day1
UnixCommands Day1
editing
Daniela Lourenco
cp –r /home/guest002/course/labs/lab1linux_une .
curl http://nce.ads.uga.edu/wiki/lib/exe/fetch.php?media=lab1Linux_une.zip -o
lab1linux.zip
Popular commands
head file prints first 10 lines
head -20 file prints first 20 lines
tail file prints last 10 lines
less file lists file line-by-line or page-by-page
less -S file lists file line-by-line or page-by-page without wrapping the text
• Merges two files by column 1 but suppresses the joined output lines
join –v1 phenotypes.txt pedigree.txt > new_file
grep
• grep finds patterns within a file and lists all lines that match the pattern
grep UGA42014 pedigree.txt
Alfred Aho
Peter Weinberger
Brian Kernighan
awk
• Interpreted program language, that process data stream of a file line by line
awk '{if ($2>0) print $2}' pedigree.txt | sort | uniq –c > s.temp
Useful commands for Linux
• Several tutorials on the WEB !!
• Online
• https://tldp.org/LDP/Bash-Beginners-Guide/Bash-Beginners-Guide.pdf