Cheatography
https://cheatography.com
Directory Operations
pwd |
Show current directory |
mkdir <dir> |
Make directory <dir> |
cd <dir> |
Change directory to <dir> |
cd .. |
Go up one directory |
ls |
List files |
File operations
cat <file> |
print the contents of <file> |
cat <file1> <file2> |
concatenate <file1> and <file2> and print the result |
less <file> |
view and paginate <file> |
cp <file1> <file2> |
copy <file1> to <file2> |
mv <file1> <file2> |
move <file1> to <file2> |
rm <file> |
delete <file> |
head <file> |
show the first 10 lines of <file> |
tail <file> |
show the last 10 lines of <file> |
nano <file> |
edit the contents of <file> |
Bash shortcuts
CTRL-c |
Stop current command |
CTRL-a |
Go to start of line |
CTRL-e |
Go to end of line |
CTRL-r |
Search history |
TAB |
Auto-complete current command or filename |
TAB TAB |
Show possible completion options |
|
Use TAB completion as much as possible, it both makes typing faster and prevents typing errors! |
Important tip
Most commands which perform an operation (cp, mv, rm, touch...) do not print any output when they are successful. If they do, probably there is an error.
In any case, always check the output of your commands carefully, to be sure that no error occurred. |
|
|
Nano Shortcuts
Saving files |
Ctrl-O |
Save file (confirm with Y) |
Ctrl-X |
Close file (confirm saving with Y) |
Cut and paste |
ALT-A |
Start marking text |
CTRL-K |
Cut marked text or line |
CTRL-U |
Paste text |
Navigate file |
CTRL-A |
Beginning of line |
CTRL-E |
End of line |
CTRL-C |
Show line number |
CTRL-_ |
Go to line number |
Search |
CTRL-W |
Find text |
ALT-W |
Find next occurrence |
Network management
ifconfig |
Display current network configuration |
ifconfig <iface> up |
activate interface <iface> |
ifconfig <iface> down |
deactivate interface <iface> |
ifconfig <iface> <ip> netmask <mask> |
configure interface <iface> with given <ip> and <mask> |
ping <ip> |
check if <ip> is reachable |
IO Redirection
command < file |
Input of command from file |
command > file |
Output of command to file |
command > /dev/null |
Discard output of command |
command >> file |
Append output of command to file |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets