Recalling command history - Bash Shell

 Recalling command history:

!! - Last command and all arguments

!-3 - Third-to-last command and all arguments

!^ - First argument of last command

!:3 - Third argument of last command

!$ - Last argument of last command

!* - All arguments of the last command

!30 - Expands to the 30th command in history

!find - Last command beginning with 'find'

!?find - Last command containing 'find'

^name^type - Last command with first instance of 'name' replaced with 'type

!:gs/name/type - Last command with all instances of 'name' replaced with 'type'

<command>:p - Don't execute and print command.


Command to trim the Whitespace:

echo -e "Here is the command to trim \n \n White space" | /usr/bin/tr -d '[:space:]'

Comments

Popular posts from this blog

Resolved: DOCKER: Error response from daemon: Could not attach to network / rpc error: code = 7 desc = network not manually attachable.

yum failed 6 times. Cannot continue!

unexpectedly shrunk window (repaired) in dmesg log - TCP Peer