Skip to content

Latest commit

 

History

History
32 lines (31 loc) · 9.8 KB

File metadata and controls

32 lines (31 loc) · 9.8 KB
UNIX commands cheatsheet
Help with UNIX commands
man {command} Manual pages are available for many UNIX commands listed below. Tip1: Press q to exit. Tip2: /keyword to search for lines with a keyword; n to go to the next occurrence and Shift + n to go to previous occurrence.
Force stopping a command
Control + c Stop a command before completion.
Navigating through directories
pwd Show the full path of your current directory.
cd {dirname} Go to a specific directory.
ls {dirname} List the files in a specific directory. Current directory is listed if no directory specified. Tip: To display additional information about the files, use ls -lh.
Moving files
cp {file1} {file2} Copy file1 and name it file2. Tip: Directories can be copied using cp -r {dir1} {dir2}.
mv {file1} {dirname} Move file1 to a different directory. Tip: You can rename (and move at the same time) a file using mv {file1} {file2}
rm {file1} Delete a file. Tip: rm -r {dirname} to remove an entire directory.
Interacting with human-readable files
cat {file1} Print the contents of a file.
wc -l Count the number of lines in a file.
head {file1} Print the top lines of a file.
tail {file1} Print the bottom lines of a file.
grep 'text' {file1} Print the lines in a file that contain certain text.
PBS jobs
qsub {jobscript} Submit a PBS job script to run on the HPC. Tip: At VAI, the walltime you request should determine whether the job goes to the 'longq' or the 'shortq'. If your lab has its own nodes, you can submit the job to your lab's queue using qsub -q queuename {jobscript}.
qsub -X -q shortq -I -l nodes=1:ppn=1 -l mem=16gb -l walltime=1:00:00 Submit an interactive job. This allows you to interact with a job node in the same way you have been interacting with the submit node. Use this, for example, to test out computationally-intensive scripts and commands as you put together a job script or workflow. exit to logout back to the submit node.
qstat -u {user.name} See the status of jobs you have submitted.
qdel {jobid} Stop a specific job.