Unix shell scripts
Notes
To use any of the following scripts, you will need to convert the following file extensions:
| Type |
Change from... |
Change to... |
| Bourne or Bash |
.sh.txt |
.sh |
| Perl |
.txt |
.pl |
Browse
-
Decrypt and encrypt file or directory using gpg, tar archiving and gzip compression.
- cpr_sbio.sh: CoPy Recursively but Skip Bad IO. Copies from a directory to a directory, but skips if not readable and deletes from destination if any problems.
- sort.pl: Sorts all parameters to this script and prints to standard output.
- print-unique.pl: Collects all lines from stdin, removes duplicates and prints to stdout.
- check-for-files-with-same-path.sh: looks in multiple directories for any files with identical relative paths.
- count-files-in-directories.sh: total count of all files in multiple directories.
- count-lines-java-code.sh: count total lines of all the java code including plain old Java classes (.java), JSP (.jsp) and JavaFX (.fx). Easily adaptable to any file type, e.g., C, C++, etc.
- info-directory.sh: total number of files and size of a directory.
- monitor-directory.sh: prints out the size of a directory every minute. Also prints the size change, along with an average of rate of change. Useful when monitor downloads or activities generating data.
- stagger-copy-for-failing-drives.sh: copies directories with pause so, if a failing drive unmounts, has time to remount. Also generates a script of directories that failed so can try to copy again. Useful when copying many directories off failing drive.
- try-find-disk-error.sh: find disk or disk controller that is throwing disk errors.
- verify-copy-many-to-one.sh: after copying files from many different directories (think partitions) to one, verify that everything from all the directories was copied.
Return to My Documents and Downloads »