# For bash, zsh
echo $PATH | sed 's/:/\n/g'# For fish
echo $PATH | sed 's//\n/g'# Output
/home/admin/.local/bin # The shell checks this directory first
/home/admin/bin
/usr/local/bin
/usr/local/sbin
/usr/bin
/usr/sbin
(Almost) everything you type to the terminal is saved.
The command history is stored at $HISTFILE, which by default:
- For bash, it's
~/.bash_history, - For zsh, it's
~/..zsh_history, - For fish, its's
~/.local/share/fish/fish_history
-
Access last command:
- Press
Arrow Up - Press
Arrow Upmore for last of last command - ...
- Press
-
Search for a command is the command history:
Ctrl + RFor a default bash, zsh prompt, it looks like this
(reverse-i-search)`’: -
Use
atuin1 for a magical 🪄 shell history, which:- records additional context for your commands
- synchronizes your history between machines/shells
-
Use
--help,-h,helpflag/option/sub-command-
Some commands support
--helpuname --help
uname -h # Does't work -
Some commands support
-hdig -h
dig --help # Doesn't work -
Some commands support both
--help,-hand even have a sub-command namedhelpgo helpgo -h
go --help
-
Some commands don't support
--helpor-h, and don't have ahelpsub-command either, e.g.ssh,ssh-keygen$ ssh -h unknown option -- h
$ ssh --help unknown option -- -
$ ssh help ssh: Could not resolve hostname help: Name or service not known
-
-
Access the command's manual pages
man uname
-
tldr uname
cheat uname