...
Table of Contents | ||
---|---|---|
|
...
Setting Up
Question:
There is a folder called
intro_to_linux
within the/project/arccatrain/
folder.How would you copy this folder into your home folder?
...
Setting Up: Answer(s)
Answer: There are a number of ways…
Code Block |
---|
# Move to your home folder and copy int this location. # The “.” marks the current working directory. [arccanetrain]$ cd [~]$ cp -r /project/arccanetrain/intro_to_linux/ . cp: cannot open 'intro_to_linux/workshop_me.txt' for reading: Permission denied [~]$ ls Desktop Documents Downloads intro_to_linux # Move into the /project/arccatrain/ folder and copy from there into your home. # The “~” is short for your home folder. [~]$ cd /project/arccanetrain/ [arccanetrain]$ cp -r intro_to_linux/ ~ cp: cannot open 'intro_to_linux/workshop_me.txt' for reading: Permission denied [arccanetrain]$ ls ~ Desktop Documents Downloads intro_to_linux # Why do we see the cp related permission denied? # -rw------- 1 arcc-t05 arccanetrain 23 Oct 5 07:20 workshop_me.txt # What happens to this file? It does not get copied. |
...
View the content of files
...
Command | Description | ||
cat |
| ||
more |
| ||
head |
|
...
View the content of files
...
Command | Description | ||
tail |
|
...
Exercises
Code Block |
---|
[]$ cd ~/intro_to_linux/ [intro_to_linux]$ cat software.csv [intro_to_linux]$ cat -n software.csv # Press spacebar to scroll through. # Press ‘q’ to quit at any time. [intro_to_linux]$ more software.csv [intro_to_linux]$ head software.csv [intro_to_linux]$ head –n 5 software.csv [intro_to_linux]$ tail software.csv [intro_to_linux]$ tail –n 5 software.csv |
...
Search for a string within a text file (grep)
Command | Description | ||
grep |
|
...
Examples: Search a file
...
Code Block |
---|
# Remember: grep is case-sensitive [intro_to_linux]$ grep NVIDIA software.csv libraries and toolkits,cuDNN,cudnn,beartooth,The NVIDIA CUDA Deep... libraries and toolkits,TensorRT,,beartooth,"NVIDIA TensorRT, an... # Nothing is returned. [intro_to_linux]$ grep nvidia software.csv [intro_to_linux]$ # Neither of the above picked up “Nvidia”. [intro_to_linux]$ grep -i NVidia software.csv compiler,NVidia HPC SDK,nvhpc,"beartooth,teton"... libraries and toolkits,cuDNN,cudnn,beartooth,The NVIDIA CUDA Deep... libraries and toolkits,TensorRT,,beartooth,"NVIDIA TensorRT, an... # Ignore the case of the word to search for. [intro_to_linux]$ grep -n -i NVidia software.csv 145:compiler,NVidia HPC SDK,nvhpc,"beartooth,teton"... 152:libraries and toolkits,cuDNN,cudnn,beartooth,The NVIDIA CUDA Deep... 166:libraries and toolkits,TensorRT,,beartooth,"NVIDIA TensorRT, an... |
...
Examples: Search folders and files
...
Code Block |
---|
[intro_to_linux]$ cd clusters/ [clusters]$ grep -i nvidia * beartooth.html: .../788758554/NVidia+HPC+SDK">NVidia HPC SDK</a></td> teton.html: .../788758554/NVidia+HPC+SDK">NVidia HPC SDK</a></td> [clusters]$ cd .. [intro_to_linux]$ grep -i nvidia * grep: clusters: Is a directory software.csv:compiler,NVidia HPC SDK,nvhpc,"beartooth,teton"... software.csv:libraries and toolkits,cuDNN,cudnn,beartooth,The NVIDIA CUDA Deep... software.csv:libraries and toolkits,TensorRT,,beartooth,"NVIDIA TensorRT, an... [intro_to_linux]$ grep -r -i nvidia * clusters/teton.html: .../788758554/NVidia+HPC+SDK">NVidia HPC SDK</a></td> clusters/beartooth.html: .../788758554/NVidia+HPC+SDK">NVidia HPC SDK</a></td> software.csv:compiler,NVidia HPC SDK,nvhpc,"beartooth,teton"... software.csv:libraries and toolkits,cuDNN,cudnn,beartooth,The NVIDIA CUDA Deep... software.csv:libraries and toolkits,TensorRT,,beartooth,"NVIDIA TensorRT, an... |
...
Exercises
Code Block |
---|
# The software.csv file takes the form: [intro_to_linux]$ head software.csv Type,Name,Module,Cluster,Description application,Alphafold,alphafold,"beartooth,teton",AlphaFold... application,Astral,astral,wildiris,ASTRAL is a tool... application,Augustus,augustus,beartooth,AUGUSTUS is a program... application,Avizo,avizo,loren-pre202308,Avizo is a general-purpose... application,ANGSD,angsd,"beartooth,teton",ANGSD: is a software... application,ANSYS,ansys,teton,"ANSYS is a general-purpose software... |
...
Which named applications are related to the words “bayes”?
Which files contain reference to IPA?
...
Answers
Code Block |
---|
[intro_to_linux]$ grep -i bayes software.csv application,Bayescan,bayescan,beartooth,"BayeScan aims... application,Beast1,beast1,wildiris,BEAST is a cross-platform program for Bayesian... application,Beast2,beast2,beartooth,"BEAST 2 is a cross-platform program for Bayesian... application,Freebayes,freebayes,beartooth,"freebayes is a Bayesian genetic... application,Jags,jags,"beartooth,teton",Just Another Gibbs Sampler. It is a program for analysis of Bayesian hierarchical... application,RevBayes,revbayes,wildiris,Bayesian phylogenetic... application,ROHan,rohan,teton,"ROHan is a Bayesian framework... application,SourceTracker2,sourcetracker2,"beartooth,teton","SourceTracker, a Bayesian approach... [intro_to_linux]$ grep -r IPA * clusters/beartooth.html: .../pages/1893597185/IPA">IPA</a></td> software.csv:application,IPA,ipa,beartooth,Improved Phased Assembler (IPA) is... |
...