Feature #6371
Linux Terminal Tutorial - Quality check Round 1
100%
Description
Performed fixes based on feedback from Stephanus Riekert
By die download van die tarball:
Nie dat ek dink dit moet verander nie maar iemand gaan vra. Jy kan die tarball met wget na die cluster download: wget https://docs.hpc.ufs.ac.za/getting-started/files/tutorial.tar.gz
Hierdie sin: The reason this file set was chosen, is because it allows plenty opportunities to practice the commands found in Linux 101 and it also shows an example of organising files in directories with meaningful prefixes that will allow one to efficiently navigate and use them in the terminal environment.
Sal ek eerder so skryf: The reason this file set was chosen, is because it has plenty of opportunities to practice the commands found in Linux 101. It also shows an example of organising files in directories with meaningful prefixes that will allow one to efficiently navigate and use them in the terminal environment.
by View the contents of the current directory using ls
Use ls to view the contents of the Tutorial directory:
$ ls #This is equivalent to using ls .
Ek dink jy sal moet verduidelik wat . en .. is maar ek sal dit eerder nie hier skryf nie maar eerder by die ls -a nvt_expr_1 command
Dalk sal dit goed wees om uitdruklik te se: ls -lh nvt_expr_1 en ls -l -h nvt_expr_1 is ekwivalent en in die algemeen geld vir ander options ook soos -lha = -l -h -a
By
Get a file list, including files in the sub-directories, recursively
It may be necessary on occasion to view the contents of directories and their sub-subdirectories. Using the -R option will systematically go into each directory in the supplied directory and print out a list of files in each:
Ek sal dit net so skryf:
It may be necessary to view the contents of directories and their sub-subdirectories. Using the -R option will systematically go into each sub-directory in the supplied directory and print out a list of files in each:
By
Find Files and Directories using find
Find all trajectory files (.trr) in the Tutorial directory:
$ find Tutorial -name "*.trr"
Ek dink die command moet wees: find . -name "*.trr"
Behalwe as ek n cd command gemis het.
By
Create sub-directories using the -p option
Create similar directory structures for analysis_npt and analysis_md by using the -p option:
$ mkdir -p analysis_npt/top
$ mkdir -p analysis_md/top
Net vir die interesantheid jy kan die twee in een doen: mkdir -p analysis_{npt,md}/top
By
Create empty files using touch
Create empty log files in each of the _analysis directories using touch:
$ touch analysis_nvt_analysis/nvt_analysis.log
$ touch analysis_npt_analysis/npt_analysis.log
$ touch analysis md_analysis/md_analysis.log
Ek dink die commands moet wees
$ touch analysis_nvt/nvt_analysis.log
$ touch analysis_npt/npt_analysis.log
$ touch analysis_md/md_analysis.log
By
Copy files using cp
Copy the .top file from nvt_expr1 to nvt_expr1/top/ using cp:
$ cp nvt_expr1/nvt_expr_1.top nvt_analysis/top/
Ek dink jy bedoel om die topol.top file in nvt_expr_1 te copy?
Die selfde vir die:
Now repeat for the other directories:
$ npt_expr1/npt_expr_1.top npt_analysis/top/
$ md_expr1/md_expr_1.top md_analysis/top/
By
Next, copy the .gro file from each main directory to structure_files simultaneously:
$ cp nvt_expr_1/nvt_expr_1.gro \
npt_expr_1/npt_expr_1.gro \
md_expr_1/md_expr_1.gro \
structure_files
Ek dink jy moet net verduidelik wat die \ doen
By
Copy multiple files simultaneously using simple regular expressions
cp nvt_expr_1/*.itp nvt_analysis/top/
In the example above the asterisk () signifies any number of characters followed by .itp. Thus all the file names ending in the .itp extension would be selected and thus copied.
Ek dink die command moet wees cp nvt_expr_1/.itp analysis_nvt/top/ en Thus all the file names ending in the .itp extension would be selected and thus copied. moet wees Thus, all the file names ending in the .itp extension would be selected and copied.
By
Copy a directory
To copy a directory and its contents, use the option -r. Copy of the newly created structure_files:
Ek dink eerder: Make a copy of the ...
By
Move a directory using mv
To move a file or directory, simply use move as you would use cp.
Create a directory backups and move the directory structure_files_backup to the newly created directory:
$ mv structure_files backup
ek dink jy sal eerder al die commands hier moet wys
mkdir backups
mv structure_files_backup backups
By
Renaming files and directories using mv
All files and directories in Linux are renamed using the mv command. While you may use rename, note that it is simply an alias for the mv command.
To demonstrate this functionality, first cd into the directory structure_files_backup
$ cd structure_files_backup
Ek dink met die vorige stappe moet hierdie wees cd backups/structure_files_backup
By
Rename the file md_expr1.gro to md_expr1.gro.original:
$ mv md_expr1.gro md_expr1.gro.orginal
Die command moet mv md_expr_1.gro md_expr_1.gro.orginal wees
Ek dink jy kan eers die regmaak dan sal ek weer van voor af deur gaan, dit raak bietjie wollerig om die commands te volg
Quality check Round 1 for Linux Terminal Tutorial Fixes, refs #6371