Similar to the next one, this is a GIF of a GIF so expect smoother results.
Cooked up some chafa sprite animation instructions:
# Sprites source: https://www.gameart2d.com/free-dino-sprites.html
wget https://www.gameart2d.com/uploads/3/0/9/1/30917885/freedinosprite.zip
unzip freedinosprite.zip
cd ./png
nano run.sh
# Paste the following:
#!/bin/bash
i=1
while true; do
chafa --clear -size 50 "Walk ($((i++))).png"
if [ $i = 11 ]; then i=1; fi
sleep 0.05
done
# Save
chmod +x ./run.sh
./run.sh
# Hold down Ctrl+C to stop
Train yourself to use chmod u+x instead of chmod +x
chmod +x grants executable rights system wide, chmod u+x just grants rights to the fileβs owner which is usually all you want.
Try it yourself:
# Create files named A, B and C in the current directory
touch ./A ./B ./C
# Observe the initial file rights
ls -la ./A ./B ./C
# Give everyone executable access to A (same as chmod a+x)
chmod +x ./A
# Give just the owner executable access to B
chmod u+x ./B
# Give just the owner and group executable access to C
chmod ug+x ./C
# Observe the new rights
ls -la ./A ./B ./C
# Cleanup
rm ./A ./B ./C
Security Bonus:
Donβt give executable rights to files at all and just run them directly. Examples: bash ./MY_FILE sh ./MY_FILE
#Shell Options
shopt -s autocd # change to named directory
shopt -s cdspell # autocorrects cd misspellings
shopt -s cmdhist # save multi-line commands in history as single line
shopt -s dotglob
shopt -s histappend # do not overwrite history
shopt -s expand_aliases # expand aliases
shopt -s checkwinsize # checks term size when bash regains control
bind "set completion-ignore-case on"
# Custom Alias
# easy resource
alias resource="source ~/.bashrc"
# Easy Open
alias open="xdg-open"
# IP colors
alias ip='ip -br -c'
alias tb='nc termbin.com 9999'
alias termbin=tb
Highlighting a really nice one, thisβll list all the users on the system (from /etc/passwd) in a human readable table.
nano ~/.bashrc
# Paste the following somewhere within:
# lsusers() Repo: https://github.com/terminalforlife/BashConfig/blob/master/source/.bash_functions
# lsusers() License: https://github.com/terminalforlife/BashConfig/blob/master/LICENSE
lsusers(){ #: List users on the system, according to '/etc/passwd'.
printf "%-20s %-7s %-7s %-25s %s\n" "USERNAME" "UID" "GID" "HOME" "SHELL"
local X
while IFS=':' read -a X; do
if [ "$1" == "--nosys" ]; then
# It's possible some users might show up if they mistakenly
# were given a HOME, but '--nosys' should otherwise work.
if [[ ${X[5]/\/home\/syslog} == /home/* ]]; then
printf "%-20s %-7d %-7d %-25s %s\n"\
"${X[0]}" "${X[2]}" "${X[3]}"\
"${X[5]}" "${X[6]}"
fi
else
printf "%-20s %-7d %-7d %-25s %s\n" "${X[0]}"\
"${X[2]}" "${X[3]}" "${X[5]}" "${X[6]}"
fi
done < /etc/passwd
}
Itβs hard to describe exactly why I like seeing which packages are installed when I go package hunting. In part itβs because iβm always jumping through VMs and I can lose track of whatβs on there.
There could be a wrapper that pulls dnf list installed, matches it to dnf search and appends [Installed] to matching package lines.
Call me immature, but when terminal output has tasteful, non-kitschy colors, I enjoy my CLI experience like 10x better. I think any and all commands (perhaps to be made into .bashrc aliases) which colorize the output are big wins, to share around.
For example, I really like glances, instead of htop now (thanks, @Mr_McBride). Even though glances takes a lot more RAM, its use of color is much more tasteful, IMHO. I hope 2021 is a year of tasteful colorization of lots and lots of common CLI utilities in Linux.
This is ground floor for the project and I intend to take it a lot further. Time allowing iβll be adding lots of features, documentation and testing.
Votes should be ranked or multiple choice in future.
For the coin flip: When DL is published, the 1st letter of the first word used at/after the 5 minute mark will decide which one I do. A to M = chatroom, N to Z = GeoIP