7 tips for using shell terminals faster and efficiently

Here are 7 tips for using shell faster and efficiently.

sudo !!

Many times we forget to prepend a command by “sudo”. Instead for getting last command, hit HOME and append “sudo”, we can type in a blank line: “sudo !!” This repeats last command prepending “sudo” to it.

CTRL + K

Sometimes we confuse ourselves about the arguments passed to a program and needs to delete the lasting portion of a command. We could of course delete by holding DELETE or BACKSPACE keys. But we could position our cursor and just hit CTRL + K. This command cuts all text after cursor.

CTRL + U

Instead of cutting text after the cursor, you can cut text before it using CTRL + U.

CTRL + Y

If after using above commands you need to undo the text cutting, just press CTRL + Y. This will give back the cutted portion.

CTRL + W

You can easily delete words backwards using CTRL + W

ALT + . (period)

Usually in penetrating testing, you need to pass the same argument between distinct shell commands like host ip. Argument repeating can be done using ALT + . after typing each program name (nmap, hping, etc).

reset

Not rarely some process die and the terminal gets into a abnormal state. Instead of hitting CTRL+C, closing our connection and restart the whole connection process, we can use reset to keep our session open.

#cybersecurity #linux #shell #bash #pentesting

Software Architect, Security Researcher and Pentester