Shortcut | Description |
---|---|
CTRL+A | move to beginning of line |
CTRL+B | moves backward one character |
CTRL+C | halts the current command |
CTRL+D | deletes one character backward or logs out of current session, similar to exit |
CTRL+E | moves to end of line |
CTRL+F | moves forward one character |
CTRL+G | aborts the current editing command and ring the terminal bell |
CTRL+J | same as RETURN |
CTRL+L | clears screen and redisplay the line |
CTRL+M | same as RETURN |
CTRL+N | next line in command history |
CTRL+O | same as RETURN, then displays next line in history file |
CTRL+P | previous line in command history |
CTRL+R | searches backward |
CTRL+S | searches forward |
CTRL+T | transposes two characters |
CTRL+U | kills backward from point to the beginning of line |
CTRL+V | makes the next character typed verbatim |
CTRL+W | kills the word behind the cursor |
CTRL+X | lists the possible filename completefions of the current word |
CTRL+Y | retrieves (yank) last item killed |
CTRL+Z | stops the current command, resume with fg in the foreground or bg in the background |
DELETE | deletes one character backward |
Variables | Description |
---|---|
!! |
repeats the last command |
$HOME |
location of the home directory |
~ |
alias to HOME |
$USER |
name of user |
$SHELL |
shell you're using |
$BASH_VERSION |
displays bash version |
display all environment variables
export
if you want to use bash (type exit to go back to your normal shell)
bash
find out where bash is on your system
whereis bash
clear content on window (hide displayed lines)
clear
list your files
ls
list your files in 'long format', which contains the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified
ls -l
list all files, including hidden files
ls -a
create symbolic link to file
ln -s <filename> <link>
create or updates your file
touch <filename>
place standard input into file
cat > <filename>
show the first part of a file (move with space and type q to quit)
more <filename>
output the first 10 lines of file
head <filename>
output the last 10 lines of file (useful with -f option)
tail <filename>
let you create and edit a file
emacs <filename>
move a file
mv <filename1> <filename2>
copie a file
cp <filename1> <filename2>
remove a file
rm <filename>
compare files, and shows where they differ
diff <filename1> <filename2>
tell you how many lines, words and characters there are in a file
wc <filename>
let you change the read, write, and execute permissions on your files
chmod -options <filename>
compresse files
gzip <filename>
uncompresse files compressed by gzip
gunzip <filename>
let you look at gzipped file without actually having to gunzip it
gzcat <filename>
print the file
lpr <filename>
check out the printer queue
lpq
remove something from the printer queue
lprm <jobnumber>
convert plain text files into postscript for printing and gives you some options for formatting
genscript
print .dvi files (i.e. files produced by LaTeX)
dvips <filename>
look for the string in the files
grep <pattern> <filenames>
search recursively for pattern in directory
grep -r <pattern> <dir>
make a new directory
mkdir <dirname>
change to home
cd
change directory
cd <dirname>
tell you where you currently are
pwd
return your username
whoami
let you change your password
passwd
show the current date and time
date
show the month's calendar
cal
show current uptime
uptime
display whois online
w
display information about user
finger <user>
show kernel information
uname -a
show the manual for specified command
man <command>
show disk usage
df
show the disk usage of the files and directories in filename (du -s give only a total)
du <filename>
list your last logins
last <yourUsername>
list your processes
ps -u yourusername
kill (ends) the processes with the ID you gave
kill <PID>
kill all processes with the name
killall <processname>
display your currently active processes
top
list stopped or background jobs ; resume a stopped job in the background
bg
bring the most recent job in the foreground
fg
bring job to the foreground
fg <job>
ping host and outputs results
ping <host>
get whois information for domain
whois <domain>
get DNS information for domain
dig <domain>
reverse lookup host
dig -x <host>
download file
wget <file>