Linux Tutorial Cheat Sheet
Linux Tutorial Cheat Sheet
qstat print list of all your jobs ps See all of your active processes
qsub <script> submit <script> as a job top Constantly updating list of ordered (by resources)
processes
qlogin login to an interactive session on the cluster
time print time taken to complete after command finishes
qdel <job ids> delete the jobs (<job ids> can be a pattern)
<command> running
Modifying directories
Processing stdout
mv [sources] [destination] rename / move directory
awk -F "," '{print print only column n of files
mkdir <directory> create a directory
$<column number>}'
rmdir <directory> remove a directory
sort (-n) sort alphabetically (alphanumerically)
rm -rf <directory> remove directory and all subdirectories
uniq (-c) print only one instance of repeated lines
(with count of lines)
Finding files
grep (-i) [pattern] print lines which contain pattern (ignore
find . -file -name Find all .txt files in the current directory and below case)
"*.txt" and print
wc -l print number of lines
locate [pattern] match files with pattern anywhere in the full path sed replace all instances matching
and print /<pattern>/<replacemen
t>/g <pattern> with <replacement>
Can combine with | grep. locate may require sudo updatedb from time to To use on a collection of files, all commands would be prefixed by:
time, and won't work on cluster without some modification. cat [files] |
Viewing files
Remote Managment
Useful
mount <partition> directory will now lead to the partiton (useful for usb
<directory> storage)