BASH commands Flashcards

1
Q

pwd

A

Presenting/print working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

ls

A

List contents of current directory (folder)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

ls*_______

A

Lists all files that end in a certain type (.pdf – .txt – .jpeg)

    • string of characters
      ? - one character
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

man COMMAND

A

Allows user to learn about the command options

Replace command with a BASH function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ls READ* > myfile.txt

A

Lists all files that start with READ and saves the list to a file name

READ is the string in the filename you are wanting to find

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

mkdir my_dir

A

Makes a new subdirectory(file) off the present working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

cd DIRECTORY

A

Change to a subdirectory of the presenting working directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

cd DIRECTORY/SUBDIRECTORY

A

Allows to change into nested subdirectories

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

cd ../

A

Allows you to move up one directory (parent directory)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

cp README.text ./directory/

A

Copies file

./directory/ indicates copying within the current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

cp -r directory1 directory2

A

Copies directory AND its
contents

-r indicates recursive, meaning that it will operate on the entire directory tree

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

mv file.txt ./directory/

A

Moves a file/directory within the current directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

rm directory/filename

A

Remove/deletes a file from directory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

rm -r directory

A

Removes a directory and its contents

recursive

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

cat filename.txt

A

Allows viewing a file with that filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

more filename.txt

A

View the file page by page

17
Q

head, tail, wc, sort, uniq, grep, sed

A

Other commands for viewing text files

18
Q

module avail

A

Listing of all modules and versions of the system available to the user

19
Q

module spider NAME

A

Detailed info about the software and instructions for loading

20
Q

module load NAME

A

Loads module and makes software available for use during current session

21
Q

module list

A

Keeps track of active modules (documents computational envt for reproducibility)

22
Q

sinfo -M gpu

A

SLURM management

Clusters current state, availability, node list, time limits, current usage status

23
Q

sequeue -u username

A

Allows users to monitor and manage their active HPC jobs

24
Q

module purge

A

Unloads previously loaded modules

25
Ctrl-A
Goes to beginning of the line
26
Ctrl-E
Goes to end of the line
27
Ctrl-R
Searches for a previously entered command
28
Up arrow
Shows the command just typed
29
Tab
Autocompletes the partially typed command
30
sbatch myscript.submit.sh
submits SLURM script
31
scancel [job id #]
cancels job using job ID number from squeue
32
What command would you use to access a remote UNIX system?
ssh username
33
What command to copy files to that system?
scp file.txt username:/
34
What is the purpose of the module system?
Only loads the software you need for the specific purpose Prevents software conflicts in HPC environments Usually has more programs than needs, so if available at the same time, they may conflict (w/o module)