Skip to content

Instantly share code, notes, and snippets.

@asela38
Last active August 5, 2018 17:06
Show Gist options
  • Save asela38/c2396e60e109507d4910fd720eb3947f to your computer and use it in GitHub Desktop.
Save asela38/c2396e60e109507d4910fd720eb3947f to your computer and use it in GitHub Desktop.

Most used Terminal Line Commands

when working on the terminal line

Use command
Toggle Between begining of line and End of Line CTRL+XX
Delete Last Word
Before:
>test one two |
After:
>test one |
ALT + BACKSPACE
Cut last Word
Before:
>test one two |
After:
>test one |
CTRL+W
Paste last cut CTRL+Y
Send Current Program to Background CTRL+Z
fg to bring it back
Execute last executed command starts with abc !abc
Print the last executed command start with abc !abc:p

useful commands

Use command
List of all crons in hourly execution order
 crontab -l | grep -v ^# | grep -v '^[[:space:]]*$' 

| cut -d' ' -f1-7 | sort -n -k 2 | column -s" " -t 
Define a wrapper for frequently used commands Create a file :> vim help.sh
 function ssh_to_remote() { 
ssh remote-server.ip
}

then :> source help.sh
now :> ssh_to_remote
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment