Skip to content

Instantly share code, notes, and snippets.

@dacr
Last active February 3, 2026 20:22
Show Gist options
  • Select an option

  • Save dacr/cacd449dfab2bda03ac5ba0d6496b651 to your computer and use it in GitHub Desktop.

Select an option

Save dacr/cacd449dfab2bda03ac5ba0d6496b651 to your computer and use it in GitHub Desktop.
bash cheat sheet / published by https://github.com/dacr/code-examples-manager #e7fa44e1-466f-4add-8c37-1b29e98a99e4/a5a038f51d88bd13fc98ff2d2ba07ba4bf5c842a

bash cheat sheet

Get running script current directory

CURR=$(dirname "$0")
CURR=$(dirname $(readlink -f $0))

Read a password

read -s -p "password:" MYPASS

Leave nothing in the bash history

unset HISTFILE
export HISTFILE=/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment