Useful Linux Commands

This is a page with explanations of various linux commands that have made my life easier

Finding/Searching Files

To search for a particular filename in the current directory and all subdirectories type

find . -name "filename"

SLURM

  • To cancel all jobs, type

squeue -u $USER | awk '{print $1}' | tail -n+2 | xargs scancel

  • If we just want to view one job, we can type squeue -u $USER and can cancel that job with scancel <jobid>.

  • To display more information about a job, can type in scontrol show job <jobid>.

  • To submit a batch job, we can type in sbatch Job.sh where Job.sh has all the SLURM directives for submitting a job. Some example directives below:
    • --ntasks-per-node=48
    • --time=1:00:00
    • --nodes=1
    • --account=PAS1066
    • --output=slurm.out
    • --constraint=48core
    • --cluster=PITZER
    • --job-name=test
    • --mail-user=desai.458@osu.edu
  • For quickly testing if a program can run, can just use srun with the SLURM directives passed in as command line arguments. In this way, the program will run in the terminal. This is more useful for seeing the output pop out in real time and for debugging.
Written on September 28, 2023