Skip to content

Instantly share code, notes, and snippets.

@JoeArauzo
Last active June 2, 2020 01:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoeArauzo/16cd3e1a215469cc5cf207c196cf643e to your computer and use it in GitHub Desktop.
Save JoeArauzo/16cd3e1a215469cc5cf207c196cf643e to your computer and use it in GitHub Desktop.
Useful shell commands

Useful Shell Commands

1. Compare files in two directories

This will allow you to compare two directories while ignoring file extensions. A good use case is when you have one directory of AIFF audio files and another directory of those same audio files which were converted to another audio format, such as FLAC. This will allow you to indentify if any are missing.

diff -u <(cd "{DIR 1}" && printf '%s\n' **/*(D:r)) \
        <(cd "{DIR 2}" && printf '%s\n' **/*(D:r))

2. Displays paths in $PATH, each on separate line

This is an easy way to see each path within the $PATH environment variable.

tr ':' '\n' <<< "$PATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment