Navigating the terminal

I use the gnome-terminal on trabant and rosinante.

Cheatsheet

Basic command line programs for every day use.

cmd Description
cd change directory
ls list directory content
pwd print working directory
mv move/rename file
cp copy file
man shows the manual of a program
lp send file to the local printer
clear clears the terminal screen
fg returns to a program running in the background
sudo execute command as priviledged user
sudo ! execute previous command as priviledged user
~ shortcut for the home directory

Shortcuts

These shortcuts work in bash.

Tab autocompletes directory and filenames
Alt modifier to jump to next space
Ctrl+C aborts programs by sending the SIGINT signal
Ctrl+Z sends SIGSTP to move the terminal above the currently running program
Ctrl+L clears the terminal screen
Ctrl+D log out of the terminal and close it
Ctrl+A move the cursor to the start of the line
Ctrl+E move the cursor to the end of the line
Ctrl+U clear the line towards the beginning
Ctrl+K clear the line towards the end
Ctrl+W delete last word
Ctrl+K delete the rest of the line after the cursor

Miscellaneous

Toggle the closing confirmation dialog:

gsettings set org.gnome.Terminal.Legacy.Settings confirm-close true/false

To check the setting, use:

gsettings get org.gnome.Terminal.Legacy.Settings confirm-close

incoming(3) | scim | w3m | bash