Difference between revisions of "Command List"

From Research Computing Center Wiki
Jump to navigation Jump to search
 
(6 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 deleted after 37 days (all contents will be deleted)
 
|-
 
|}
 
 
 
===SGE commands===
 
 
 
{|  width="100%" border="1"  cellspacing="0" cellpadding="2" align="center" class="wikitable unsortable"
 
 
|-
 
|-
! scope="col" | Command
+
| scancel || Cancel a queued or running job
! scope="col" | Action
 
 
|-
 
|-
 
+
| squeue || Check the status of queued and running jobs
 
|-
 
|-
| qsub || Submit a job to the queue
+
| squeue --me || List all jobs for the user running the command
 
|-
 
|-
| qdel || Cancel a queued or running job
+
| sinfo || List all nodes and their state
 
|-
 
|-
| qhold || Place a queued job on hold
+
| scontrol show job ''jobid'' || Shows information about pending or running jobs, until very shortly after a job finishes
 
|-
 
|-
| qstat || Check the status of queued and running jobs
+
| sacct -X -j ''jobid'' || Shows status/information about a job
 
|-
 
|-
| qacct || List properties of finished jobs
+
| sacct-gacrc -X -j ''jobid'' || <code>sacct</code> with some useful pre-formatted fields
 
|-
 
|-
| qstat -g c || List all valid queue names
+
| sacct-gacrc-v ''jobid'' || <code>sacct-gacrc</code> displayed vertically, line by line
 
|-
 
|-
 
|}
 
|}
  
 
===Text Editors===
 
===Text Editors===
zcluster has the following text editors available: '''vi''', '''vim''', '''emacs''', '''xemacs''', '''nano''', '''nedit'''.
+
Sapelo2 and the teaching cluster have the following text editors available: '''vi''', '''vim''', '''emacs''', '''nano'''.

Latest revision as of 15: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.