Command List: Difference between revisions

From Research Computing Center Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(8 intermediate revisions by one other user not shown)
Line 1: Line 1:
[[Category:Zcluster]]
[[Category:Sapelo2]][[Category:Teaching]]
 
 
Below is a short list of commands that can be used on a system running Linux.
 
A series of short and very easy to follow videos covering the basics of Linux are available in Kaltura (login with your UGA MyID and password) at https://kaltura.uga.edu/channel/GACRC/176125031
 


===General Linux Commands===
===General Linux Commands===
Line 103: Line 109:
|}
|}


===zcluster specific commands===
 
===Slurm commands===


{|  width="100%" border="1"  cellspacing="0" cellpadding="2" align="center" class="wikitable unsortable"
{|  width="100%" border="1"  cellspacing="0" cellpadding="2" align="center" class="wikitable unsortable"
Line 112: Line 119:


|-
|-
| quotarep || Reports how much space you are using on the file systems
| sbatch || Submit a job to the queue
|-
|-
| make_escratch || Creates an ephemeral scratch directory, which is delete after 38 days (all contents will be deleted)
| scancel || Cancel a queued or running job
|-
|-
|}
| squeue || Check the status of queued and running jobs
 
===SGE commands===
 
{| width="100%" border="1"  cellspacing="0" cellpadding="2" align="center" class="wikitable unsortable"
|-
|-
! scope="col" | Command
| squeue --me || List all jobs for the user running the command
! scope="col" | Action
|-
|-
 
| sinfo || List all nodes and their state
|-
|-
| qsub || Submit a job to the queue
| scontrol show job ''jobid'' || Shows information about pending or running jobs, until very shortly after a job finishes
|-
|-
| qdel || Cancel a queued or running job
| sacct -X -j ''jobid'' || Shows status/information about a job
|-
|-
| qhold || Place a queued job on hold
| sacct-gacrc -X -j ''jobid'' || <code>sacct</code> with some useful pre-formatted fields
|-
|-
| qstat || Check the status of queued and running jobs
| sacct-gacrc-v ''jobid'' || <code>sacct-gacrc</code> displayed vertically, line by line
|-
| qacct || List properties of finished jobs
|-
| qstat -g c || List all valid queue names
|-
|-
|}
|}
===Text Editors===
Sapelo2 and the teaching cluster have the following text editors available: '''vi''', '''vim''', '''emacs''', '''nano'''.

Latest revision as of 14:47, 23 June 2021


Below is a short list of commands that can be used on a system running Linux.

A series of short and very easy to follow videos covering the basics of Linux are available in Kaltura (login with your UGA MyID and password) at https://kaltura.uga.edu/channel/GACRC/176125031


General Linux Commands

Moving around in the file system

Command Action
pwd "Print working directory" - show what directory you are in.
ls List the contents (files and subdirectories) of a directory.
ls -l List the contents of a dir and show additional info of the files.
ls -a List all files, including hidden files, which typically start with a dot.
ls -lh List the contents of a dir and show additional info of the files (the files sizes are given in easy to read units).
ls -lt List the contents of a dir in cronological order with most recent files on top and show additional info of the files.
cd dirname Change to the dirname directory.
cd .. Go to the top level of your home directory.

Examining files

Command Action
file filename Determine the type of a file.
cat filename Concatenate a file.
less filename View text files and paginate them if needed.
more filename View text files, one page at a time.


Manipulating files and directories

Command Action
cp filename dirname Copy a file into a directory.
cp filename1 filename2 Copy a file into another.
cp -i filename dirname Copy a file into a directory and ask before overwriting.
cp -i filename1 filename2 Copy a file into another and ask before overwriting.
cp -r dir1 dir2 Copy a directory with its contents.
mv filename dirname Move a file into a directory.
mv filename1 filename2 Renames a file.
mv -i filename dirname Move a file and ask before overwriting.
mv -i filename1 filename2 Rename a file and ask before overwriting.
rm filename Remove a file.
rm -r dirname Remove a directory with its contents.
rm -i filename Ask before removing a file.
rm -i -r dirname Ask before removing a directory and its contents.
mkdir dirname Make a directory.
rmdir dirname Remove an empty directory.

Converting files to Linux format

Command Action
dos2unix filename Removes DOS/Windows line endings in file.
mac2unix filename Removes Mac line endings in file.


Slurm commands

Command Action
sbatch Submit a job to the queue
scancel Cancel a queued or running job
squeue Check the status of queued and running jobs
squeue --me List all jobs for the user running the command
sinfo List all nodes and their state
scontrol show job jobid Shows information about pending or running jobs, until very shortly after a job finishes
sacct -X -j jobid Shows status/information about a job
sacct-gacrc -X -j jobid sacct with some useful pre-formatted fields
sacct-gacrc-v jobid sacct-gacrc displayed vertically, line by line

Text Editors

Sapelo2 and the teaching cluster have the following text editors available: vi, vim, emacs, nano.