$ awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -n
References :
Idle Curiosity: Which shell commands loom large?
How do I see what my most used linux command are? - Super User
$ awk '{print $1}' ~/.bash_history | sort | uniq -c | sort -n
$ vi ~/.bashrcexport HISTIGNORE="pwd:ls:ls -ltr:unzip *"
myfunc() {
str=$1
echo $str
}
callback_handler="myfunc"
if [ "$callbak_handler" != "" ]; then
eval $file_handler asdfghjkl
fi
my_signal_handler() {
echo '....'
}
trap 'my_signal_handler' EXIT HUP TERM INT
jobs=() trap '((${#jobs[@]} == 0)) || kill ${jobs[*]} ; exit' EXIT HUP TERM INT subscript1 & jobs+=($!) subscript2 & jobs+=($!)
References :
zsh - Killing subprocesses after the script has finished or is killed - Unix & Linux Stack Exchange
ARR=()
ARR+=(1)
ARR+=(2)
jobs=()
(echo "$BASHPID" > pid-file; exec inotifywait -m ...) | while IFS= read -r...
jobs+=(`pid-file`)
FILE='/etc/passwd'
x=0
while [ $x -lt $(cat $FILE | wc -l) ]
do
let x=x+1
head -n $x $FILE | tail -n 1
done
$ while read line; do echo -e "$line\n"; done < file.txt