All tags
globbing
Shell12
- Tip
echo {01..10}{01..10..2} in bash counts with zero padding and a stepBrace expansion can pad numbers with zeros and skip values with a step.3 Dec 2026 - Tip
shopt globskipdotsshopt globskipdots decides whether .* matches the . and .. entriesControls whether a pattern like .* also matches the current and parent folder entries.3 Dec 2026 - Tip
set -fset -f turns off globbing until you set +fSwitches off filename expansion in the current shell, so a * is passed on as a plain character.3 Dec 2026 - Tip
GLOBIGNORE='*.bak:*~'GLOBIGNORE hides backup files from every shell wildcardKeep *.bak or *~ files out of every * you type in that session.30 Nov 2026 - Tip
ls[0-9] and [!0-9] in a shell glob match one character from a setPick files by a digit or letter in a fixed spot, without regex.30 Nov 2026 - Tip
rm old-*.logCtrl-x * expands a wildcard on the bash line before you run itSee exactly which files a glob matches, and edit the list, before pressing Enter.30 Nov 2026 - Tip
shopt -s nocaseglobshopt -s nocaseglob makes shell wildcards ignore upper and lower caseMatch photo.JPG and photo.jpg with one pattern.30 Nov 2026 - Tip
shopt -s extglob*.@(jpg|png) matches several extensions in one shell globMatch a list of extensions without the empty results that braces leave.30 Nov 2026 - Tip
shopt -s dotglobshopt -s dotglob makes * match hidden files tooLets the * wildcard include files whose names start with a dot.28 Nov 2026 - Tip
for f in *.log; doShopt -s nullglob stops a for loop from running on a literal *.logMakes a bash glob that matches no files disappear, so loops skip instead of failing.27 Nov 2026 - Tip
shopt -s extglobWith extglob, !(*.log) matches everything except your log filesLists or selects every file except the ones matching a pattern, using Bash extended globs.18 Jul 2026 - Tip
shopt -s globstarshopt -s globstar lets ** match files in every subfolderTurns on ** in Bash so one pattern matches files in every subfolder.13 Jul 2026
Nothing matches.