Taken from the following article
http://www.skorks.com/2009/09/bash-shortcuts-for-maximum-productivity/
* Ctrl + a – go to the start of the command line
* Ctrl + e – go to the end of the command line
* Ctrl + k – delete from cursor to the end of the command line
* Ctrl + u – delete from cursor to the start of the command line
* Ctrl + w – delete from cursor to start of word (i.e. delete backwards one word)
* Ctrl + y – paste word or text that was cut using one of the deletion shortcuts (such as the one above) after the cursor
* Ctrl + xx – move between start of command line and current cursor position (and back again)
* Alt + b – move backward one word (or go to start of word the cursor is currently on)
* Alt + f – move forward one word (or go to end of word the cursor is currently on)
* Alt + d – delete to end of word starting at cursor (whole word if cursor is at the beginning of word)
* Alt + c – capitalize to end of word starting at cursor (whole word if cursor is at the beginning of word)
* Alt + u – make uppercase from cursor to end of word
* Alt + l – make lowercase from cursor to end of word
* Alt + t – swap current word with previous
* Ctrl + f – move forward one character
* Ctrl + b – move backward one character
* Ctrl + d – delete character under the cursor
* Ctrl + h – delete character before the cursor
* Ctrl + t – swap character under cursor with the previous one
* Ctrl + ] - search forward for character
* Ctrl + Alt + ] - search backwards for character
Command Recall Shortcuts
* Ctrl + r – search the history backwards
* Ctrl + g – escape from history searching mode
* Ctrl + p – previous command in history (i.e. walk back through the command history)
* Ctrl + n – next command in history (i.e. walk forward through the command history)
* Alt + . – use the last word of the previous command
Command Control Shortcuts
* Ctrl + l – clear the screen
* Ctrl + s – stops the output to the screen (for long running verbose command)
* Ctrl + q – allow output to the screen (if previously stopped using command above)
* Ctrl + c – terminate the command
* Ctrl + z – suspend/stop the command
Bash Bang (!) Commands
Bash also has some handy features that use the ! (bang) to allow you to do some funky stuff with bash commands.
* !! - run last command
* !blah – run the most recent command that starts with ‘blah’ (e.g. !ls)
* !blah:p – print out the command that !blah would run (also adds it as the latest command in the command history)
* !$ – the last word of the previous command (same as Alt + .)
* !$:p – print out the word that !$ would substitute
* !* – the previous command except for the last word (e.g. if you type ‘find some_file.txt /‘, then !* would give you ‘find some_file.txt‘)
* !*:p – print out what !* would substitute
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2009
(143)
-
▼
September
(68)
- Using %\\ for strings instead of "" or ''
- Clicking on links in Webrat using XPath
- Problem with nested attributes for has one relatio...
- Best built in Vim color theme for Rails
- Run windows maximized by default in Ubuntu
- Make Gnome Panel autohide 100%
- Rip video or audio from Youtube video
- Using Irssi
- % and # in Vim
- Select last tab in Firefox
- Insert shell output into Vim
- How to use Git tags
- Record & playback Screen session
- Git fetch remote branches
- Aborting a Git rebase
- Send message to all users attached Screen session
- Pair programming Editors/ IDE plugins
- Intel Core 2 Duo vs AMD Turion X2 Ultra
- Use rtcwake to "wake up" from sleep mode at a give...
- View difference between Ubuntu date and Bios clock
- Using Rsync to synchronize folders between machines
- Installing PADevchooser gui for pulseaudio
- Finding CPU info in terminal
- Find files & directories in terminal
- List of bash shortcuts
- Make long multiple system commands in ruby more re...
- Adding digital signature to a Office document
- Best way to edit pdf files in Linux
- Annotate over PDF files using flpsed in Linux
- Copy into global clipboard in Vim
- An example .screenrc file
- Searching in Less
- Screen profile in Ubuntu
- Using single Screen session with multiple windows
- Execute shell commands in Vim
- Scrolling in Screen session
- Status flags in Mutt
- List files with human readable filesize
- Pipe less with colors
- Share screen session on iPhone
- Share terminal session to remote user using screen
- Ruby Case statements
- Ruby metaprogramming toolbox
- Dir.glob to get filenames in directory
- Use File.join to state file pathname
- Highlight line in Vim
- Open shell in Vim
- Use "p" instead of "puts Object.inspect"
- Autocomplete in Vim
- Better testing of form elements in Cucumber using ...
- Using a factory name that doesn't correspond to a ...
- Use TightVNC viewer with Vino
- Batch remove/rename files in terminal
- Installing Hamachi for remote desktop (VNC) over VPN
- Formatting of date in bash terminal
- Ruby regular expression
- Parse timestamp string to ruby Time object
- Building a command line twitter client
- Using ruby to output ansi colors in terminal
- Commandline password prompt in ruby
- Use nmap to scan for open ports
- How to use irssi
- Tips to use mobileterminal on iPhone
- Cucumber feature template
- Do not use Ruby's Enumerable find() method in Rails
- The problem with using Rail's try() method
- Git: creating, pushing & deleting remote branches
- Hidden features of Ruby
-
▼
September
(68)
No comments:
Post a Comment