Bash and Linux Command Line Tricks

Named Directories

Somewhere in your .bashrc:

set -o physical
export CDPATH=~/.cdpath:~/DIR

Symlinks in ~/.cdpath

ln -s ~/.cdpath/NICKNAME /path/to/actual/directory

Now you can cd NICKNAME from anywhere. Note all subdirectories of ~/DIR are also included and tab completion works too.

Password Generation

pwgen

Or when not available:

 < /dev/urandom tr -cd "[:alnum:]" | head -c 32 ; echo

Page Metadata

Source: bash.md Created: 2024-10-23T16:34:24+03:00 Changed: 2025-02-13T15:17:53+02:00