Skip to content

Latest commit

 

History

History
executable file
·
57 lines (40 loc) · 1.34 KB

README.md

File metadata and controls

executable file
·
57 lines (40 loc) · 1.34 KB

Useful Bash scripts

A collection of useful Bash scripts to assist with terminal workflow.


Potentially destructive scripts (can delete files interactively):

extract - Extracts every archive in the current directory and subdirectories.


Scripts that can create files, but won't delete any:

new-md5 - Recursively creates MD5 files and checks for missing entries in existing MD5 files.

dir2cbz - Converts given directories to comic book archives.


Scripts that won't create or delete files, eg. info aggregators:

files - Lists all filetypes in the current directory. Useful when searching for unnecessary files. Example output:

$ files /dir/to/documents
      3 jpg
      7 txt
     31 md
41 total

chars - Prints contents of stdin in a single list, containing each occuring character once. Useful for finding invalid filename characters when moving between filesystems or looking for specific characters in a file.

$ find . -type f | sed 's,^.*/,,g' | chars
-._~0123456789aAbcCdDeEfFgGhHiIjklmMnoOprRsStTuvwxyz

$ find . -type f | sed 's,^.*/,,g' | chars A-Za-z0-9
-._~

file-depths - Calculates file counts for each directory depth and groups them together. Useful when organizing a directory. Example output:

$ file-depths /dir/to/documents
      3 
     91 /
    102 //
     39 ///