Category shell

Shell: Command: Search in history with Ctrl-R Ctrl-S

You can search forward as well. From the bash info manual, “8.2.5 Searching for Commands in the History“: To search backward in the history for a particular string, type C-r. Typing C-s searches forward through the history. The problem with…

Remove all comments and empty lines

Grep will remove all comments and sed will remove all empty lines # grep -v “^#” | sed -e ‘/^$/d’ Same with sed # cat | sed ‘/ *#/d; /^ *$/d’