Command List

From Research Computing Center Wiki
Jump to navigation Jump to search


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.