Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Answer: There are a number of ways…

Info

Method 01: Move to into your home folder and copy into this location.

The . marks the current working directory.

...

Info

Method 02: Move into the /project/<project-name>arccatrainname>/ folder and copy from there, into your home.
Remember, the ~ is short for your home folder.

...

Command

Description

tail

Code Block
Usage: tail [OPTION]... [FILE]...
Print the last 10 lines of each FILE to standard output.
 -f, --follow[={name|descriptor}]
                           output appended data as the file grows;
                             an absent option argument means 'descriptor’
 -n, --lines=[+]NUM       output the last NUM lines, instead of the last 10;
                             or use -n +NUM to output starting with line NUM

...

Exercises: View Files: Give it a go.

Info

Question: Within the intro_to_linux folder, how can we view the contents of the software.csv file?

  1. How can we view the entire file?

  2. How can we view the start of the file?

  3. How can we view the end of the file?

...

Info

Within the intro_to_linux folder, how can we view the contents of the software.csv file?

1. How can we view the entire file?

...

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 ..
Info

Remember: case-sensitivity:

...

Info

We will be using the software.csv file:

Lets take a quick look at it using head to view the first few lines:. How is this structured? What columns do we have?

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...

...

Info

Question 01: Which named applications are related to the words “bayes”?

We have a csv file, with comma separated columns, the second column represents the name of the application.

This assumes we want to find all instances of “bayes” regardless of case.

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...
Info

Which of the returned lines represent an application with bayes within it’s name column?

Code Block
[intro_to_linux]$ grep -i bayes software.csv
application,Bayescan,bayescan,beartooth,"BayeScan aims...
application,Freebayes,freebayes,beartooth,"freebayes is a Bayesian genetic...
application,RevBayes,revbayes,wildiris,Bayesian phylogenetic...

The other returned lines are “lines that contain the word bayes within it” - so not strictly what we are looking for.

Info

Question 02: Which files contain reference to IPA?

In this case we want to explicitly search for IPA (all upper-case) and recursively search through all folders.

...