Bash Tips
Collection of Bash tips and tricks
-
2024-07-13 04:17:53
TLDR find <DIRECTORY> -type f -exec <COMMAND> {} '+'
-
2019-11-02 04:37:30
TLDR <COMMAND>; history -d $((HISTCMD-1))
-
2019-08-25 04:01:32
TLDR utilize here-doc or here-string
-
2019-08-24 01:28:33
TLDR ls -1 ensures output is one directory or file per line
-
2019-08-18 23:24:35
TLDR local -n list_name
-
2019-08-18 08:09:37
TLDR use a for loop over indices
-
2019-08-16 19:11:53
TLDR man --pager='less -p "Shell Function Definitions"' bash
-
2019-08-16 00:09:07
TLDR use now(){ date +'%Y-%m-%d %H:%M:%S'; }
-
2019-08-14 22:01:32
TLDR use /<pattern>/<substitution> or //<pattern>/<substitution> to find/replace first or all occurrences in a list
-
2019-08-13 06:15:53
TLDR read -r -d '' _var <<EOF
-
2019-08-12 06:00:56
TLDR script -ac "sudo apt-get upgrade" "$(date +'%Y-%m-%d')_sudo_apt-get_upgrade.script"
-
2019-08-12 00:06:38
TLDR printf '%q\n' 'some th!ng n@$ty'
-
2019-08-11 22:34:50
TLDR man --pager='less --pattern=" -P pager"' man
RSSv2
or
Atom