Part 6 Appendices

6.1 Other workshop files

First workshop material

6.2 Local access of files on the HPC

Mac: 1. Click Finder > “Go” in task bar > “Connect to Server” in the pulldown menu. 2. Type smb://pn.vai.org and click “Connect”. 3. Select ‘projects’ and ‘researchtemp’. Click “OK”. 4. You can now navigate using Finder, or type ls /Volumes/projects/ or ls /Volumes/researchtemp/ in the Terminal.

Windows: * In File Explorer, type \\pn.vai.org\ and hit Enter.

6.3 Bash cheatsheet

Name Command Line Description Example
Print Working Directory pwd Displays the current working directory

[username\@submit002 ~]$ pwd

Result:/home/username
List ls Lists the files and directories in the current directory

[username\@submit002 ~]$ ls

Result: It returns empty after the $ symbol since nothing has been created.
List More Detail ls -lht Display more details about the file

[username\@submit002 ~]$ ls -lht

Result: Display file detail in the current director
Make Directory mkdir Creates a new directory

[username\@submit002 ~]$ mkdir hpc_mini_workshop

Result: A hpc_mini_workshop folder is created.
Move mv Moves or renames files or directories

[username\@submit002 ~]$ mv hpc_mini_workshop workshopTraining

Result: Now the hpc_mini_workshop directory is called workshopTraining
Change Directory cd Change to an existing directory

[username\@submit002 ~]$ cd workshopTraining

Result: [username@submit002 workshopTraining]$ Notice ~ was in the home directory, now in the workshopTraining directory.
Remove rm Deletes files and directories

[username\@submit002 ~]$ rm -r TaskProject

*Note: -r means directory

Result: TaskProject is deleted
Copy cp Copies files or directories

[username\@submit002 ~]$ cp -r Task1 Project

Result: Task1 directory has moved to the Project directory.
Search for File find Search for files and directories based on various criteria like name, size, and modification time

[username\@submit002 ~]$ find Project

Result: Task1 will appear within the Project directory

Project Project/Task1
Head head Display at the beginning of a file

[username\@submit002 ~]$ head -n5 file_name

Result: It will display the first 5 lines from the beginning of the file_name.
Tail tail Display at the end of a file

[username\@submit002 ~]$ tail -n5 file_name

Result: It will display the last 5 lines from the end of the file_name
Less less Load the necessary portion of a file

[username\@submit002 ~]$ less file.txt

Result: The user is able to view a portion of the file.txt.
More more Load the entire file

[username\@submit002 ~]$ more file.txt

Result: The user is able to view the entire file.txt.
Quit q Stop viewing the current file quit viewing the current file
Concatenate cat Display the contents of a file

[username\@submit002 ~]$ cat file.txt

Result: Display the contents of file.txt
Search for Text grep Search for a specific pattern of text within files

[username\@submit002 ~]$ grep “GCGGA” sequence_file.fastq

Result: Display any GCGGA pattern in sequence_file.fastq
Word, Line, and Character Count wc Display the number of words, lines, and characters in a file

[username\@submit002 ~]$ wc file.txt

Result: Display the number of words, lines, and characters in the file.txt.
Touch touch Create a new empty file

[username\@submit002 ~]$ touch exampleFile.txt

Result: The command line will display file details in the current directory