Home Tools

Bash

Interacting with the current line

Command Description
ctrl+yPaste the yanked text
ctrl+wCut text from cursor to beginning of word
ctrl+cCancel the current command
ctrl+sStop scrolling text without cancelling the current command
ctrl+qResume stopped scrolling text from ctrl+s command
ctrl+lClear the screen, just like the clear command
ctrl+aGo to the start of the line
ctrl+eGo to the end of the line
ctrl+kDelete from the cursor to the end of the line
ctrl+uDelete from the cursor to the start of the line
ctrl+xxJump between cursor and start of line
ctrl+tSwap characters on either side of the cursor
alt+bMove backword a word
alt+fMove forward a word
ctrl+_Undo manipulation of the current line

Shortcut Commands

Command Description
!! Run the last command

Variables

Set a variable, only available in the current shell
BIKE='bmw'
Make that variable available in sub shells
export BIKE
Set a variable, available in sub shells
export BIKE='bmw'

Ubuntu shell shortcuts

Open a shell in a new window
ctl+alt+t
Open a shell in a new tab in the same window
ctl+shift+t
Exits the shells (equivalent to typing 'exit')
ctl+d
Print exported variables
env
Print local variables
set
get more information about a bash command using type
$ type echo
echo is a shell builtin
$ type ll
ll is aliased to `ls -alF'
$ type env
env is hashed (/usr/bin/env)
Shell redirection
ls > file.txt
Shell options
set -o

Aliases

Functions

Open Questions