Programming humor

Panki

BOFH
VIP
Messages
13,011
Some protips I've learned over the years (aka Pankis' shell cheat sheet).
This all applies to bash, YMMV.

CTRL + A: Jump to first postion (Home)
CTRL + E: Jump to last postion (End)
CTRL + XX: Jump to first position, doing it again jumps back to where the cursor was.
CTRL + U: Store the currently typed command and clear the prompt. (I.e. you type a command and realize you need to do something else first)
CTRL + Y: Restore what you saved with CTRL + U.
CTRL + Q: Pause the output of a program
CTRL + S: Resume output
CTRL + Z: Suspend currently running program (job control)
CTRL + L: Clear the screen

ESCAPE, #: Put a # infront of the current prompt and submit it (basically comments out your current command, can still be found via history)
ESCAPE, BACKSPACE: Remove whole word.

There are lots more, but these are the ones I find most useful and actually use quite a lot.
Anyone interested in aliases? :biggrin:
 

Mave

TMS Founder
Staff member
Messages
134,677
Location
Belgium
Some protips I've learned over the years (aka Pankis' shell cheat sheet).
This all applies to bash, YMMV.

CTRL + A: Jump to first postion (Home)
CTRL + E: Jump to last postion (End)
CTRL + XX: Jump to first position, doing it again jumps back to where the cursor was.
CTRL + U: Store the currently typed command and clear the prompt. (I.e. you type a command and realize you need to do something else first)
CTRL + Y: Restore what you saved with CTRL + U.
CTRL + Q: Pause the output of a program
CTRL + S: Resume output
CTRL + Z: Suspend currently running program (job control)
CTRL + L: Clear the screen

ESCAPE, #: Put a # infront of the current prompt and submit it (basically comments out your current command, can still be found via history)
ESCAPE, BACKSPACE: Remove whole word.

There are lots more, but these are the ones I find most useful and actually use quite a lot.
Anyone interested in aliases? :biggrin:
Cheers, these will come in handy for sure. And the aliases? No idea but shoot :biggrin:
 

Panki

BOFH
VIP
Messages
13,011
alias sum="awk '{s+=$1} END {print s}'"
alias findinfiles="grep -rn '.' -e "
alias sortedports="netstat -tlpn | sort -t: -k2 -n"
alias fucking="sudo"
 
Messages
10,949
Yeah, I set the fucking="sudo" as well. Causes hilarious moments if you have to show someone something on the terminal.

"Did... Did you just type in 'fucking' and it worked?"
"... Yeah."
 
Top