Test color support in bash

for i in {0..255} ; do printf "\x1b[48;5;%sm%3d\e[0m " "$i" "$i" if (( i == 15 )) || (( i > 15 )) && (( (i-15) % 6 == 0 )); then printf "\n"; fi done

November 18, 2017  |  🏷️bash

Bash Cheatsheet

Great links for bash greycat’s wiki Useless Use of Cat Award Rename multiple files I have multiple directories with the following format: directory.name [word123] directory.name1 [word123] directory.name2 [word123] directory.name3 [word123] etc. I would like to remove the [word123] from each directory name. It is unreasonable to perform a mv for each as there are simply too many! for r in ./*\ \[word123\]; do mv "$r" "${r%\ \[word123\]}"; done Switch to a fake bash login-shell exec -l bash # If you're in bash: bash -c 'exec -l bash' # If you're in another shell Fake running program name (exec -a 'vim thesis....

August 28, 2014  |