Skip to content

Latest commit

 

History

History
222 lines (156 loc) · 4.53 KB

UNIX.md

File metadata and controls

222 lines (156 loc) · 4.53 KB
layout mathjax permalink
page
false
/UNIX/

Getting Started

  1. Logging Into the Computing Clusters
  2. Basic UNIX
  3. Python

Basic UNIX

Contents

  1. Basic Comamands
  2. Wildcards
  3. Text Editors
  4. Submitting Jobs

Basic Commands

These are some of the basic commands that you will be using in the shell on a daily basis.


ase-gui <file_name>

Graphical user interface for the Atomic Simulation Environment (ASE). This is the tool you will be using for viewing or setting up your structures.


cd ..

Move up one directory.


cd <directory_name>

Changes directory to the one provided. If no directory is given, the default is to return you to your home directory (/home/username/)


cp <source_file_with_path> <destination_path>

Copies files or directories from the source_file_with_path to the destination_path


cp -r <source_file_with_path> <destination_path>

Copy recursively. Useful for copying multiple files and directories (copies contents of the subdirectories).


cp -u <source_file_with_path> <destination_path>

Update. Copies only if the source file is newer than the destination file or the destination file does not exist.


mkdir <directory_name>

Create new a new directory.


mv <source_file> <destination_file>

Move or rename file.


ls <directory_name>

Lists the files and directories contained within the directory. Leave blank for present directory.


ls -t

List files in chronological order.


ls -la

List all files even those starting with a dot '.' which are generally not listed.


ls | more

If the number of files in a directory is too large to fit in a single screen this command lists files and directories page after page on spacebar keystroke.


pwd

Provides the “present working directory,” i.e. the current folder.


rm <file>

Remove files. This is always permanent.


rm -r <file_or_directory_with_path>

Remove file or the directory and its contents recursively.


rmdir <directory_name>

Remove an empty directory. Use rm -r to remove recursively, such as if directory contains files (be careful).


cat <file_name>

Print out contents of a text file or files within the shell.

Wildcards

Wildcards can be used to perform commands on multiple files simultaneously.


?

Single character. Example: ag neb?.traj neb??.traj will use ag to open all files containing one or two characters between neb and .traj


*

Any number of characters. Example: ls *.traj will list all .traj files.

Text Editors

There are several text editors available. Popular ones include vim and nano.

Submitting Jobs

These instructions are specific to the Stampede cluster.

sbatch <script_file>

Submit the job defined by the script file to the queue.


sbatch --job-name=$PWD <script_file>

I recommend specifying --job-name=$PWD so it will set the current directory as the job name. This way you will have this information in the email.

sq

Check the status of your jobs. You will get something like the following:

           JOBID   PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON)
           8345154 development     test tg829713  R       0:17      1 c558-104

Shows more useful details about the job, including the working directory of the script.

squeue -u $USER -o '%.7i %.9P %.8j %.8u %.2t %.10M %.6D %R %Z'

You will get something like the following:

JOBID PARTITION     NAME     USER ST       TIME  NODES NODELIST(REASON) WORK_DIR
8345154 developme     test tg829713  R       1:12      1 c558-104 /work/03672/tg829713/scaling/QE/test

To delete your job. You can get the job ID from sq and use scancel to delete it.

scancel <job_ID>