Intermediate Directory and File Manipulation

The basic Linux command for directory creation is mkdir $DIRNAME, with the most common options being -p to create parent directories and the handy verbose flag (-v) to print the directories to standard output as they are created. An array of subdirectories can also be created. e.g.,


$ mkdir -p -v examples/{dir1,dir2,dir3}
mkdir: created directory 'examples'
mkdir: created directory 'examples/dir1'
mkdir: created directory 'examples/dir2'
mkdir: created directory 'examples/dir3'


$ for d in examples/*/; do mkdir -v "${d}RHEL7"; done
mkdir: created directory 'examples/ABAQUS/RHEL7'
..

Then checked with the ever-veristile find command:


$ find . -type d -name RHEL7
./GROMACS/RHEL7
./R/RHEL7
..

A short script copies the 2015 and 2019 application files, which the author had the foresight to use the Year as a prefix naming convention. This makes use of an expanded variable, globbing, find, conditional tests, branching, redirection of standard error, and moving files.

A list of symlinks was also identified with find;
find . -mindepth 1 -maxdepth 2 -type l -ls.

AttachmentSize
Plain text icon 786.txt580 bytes