Anda di halaman 1dari 1

LINUX CHEAT SHEET

Essential shortcuts cd Change directory. grep Search inside text files for patterns.
Ctrl+Alt+F1 Switch to the first text terminal. cd ~ Switch to the home directory. grep -i Search ignoring case.
Ctrl+Alt+Fn (n=1..6) Switch to the nth text terminal. cd - Go to previous directory. grep -w Search for whole words only.
Ctrl+Alt+F7 Switch to the first GUI terminal. cd .. Go one directory up. grep -n Show line numbers where words appear in files.
Ctrl+Alt+Fn (n=7..12) Switch to the nth GUI terminal. cp [source] [destination] Copy files. Use grep | grep Search for words inside search results.
Ctrl+Alt+BkSpc Kill the current X-windows server. cp -R [source] [destination] Copy the contents of the source find Find files.
Ctrl+Alt+Del Shut down the system and reboot. directory. find -name Find files by name.
Ctrl+C Kill the current process. mv [source] [destination] Move or rename files. find -user Find files by ownership.
Ctrl+Z Send the current process to the background. ln [source] [destination] Create a hard link called destination to find -type Find files by file type.
the file called source.
find -exec Execute a command on every found file.
Getting help ln -s [source] [destination] Create a symbolic link called
command --help Display a brief help on a command. destination to the file called source. Shell
man topic Display the contents of the system manual pages on rm Remove (delete) files. history View the command-line history.
the topic (e.g. man ls). Press Q to quit the viewer. rm -Rf Remove files and directories that aren’t empty. !! Run the last command again.
help command Display brief info on a bash built-in command. mkdir Create a new directory. ![##] Run a previous command by its number (use history
mkdir -p [dir1/dir2/dir3] Create a new directory and any to find command’s number).
Working with commands
necessary subdirectories. alias Display all command aliases.
; Run several commands sequentially. Example: mkdir
monkey; mv ~/monkey.txt ~/monkey/ rmdir Remove an empty directory. alias [alias]='[command]' Create a new temporary alias.
&& Run commands only if the previous ones succeed. Example: alias [alias name]='[command]' Create a new permanent
apt-get update && apt-get dist-upgrade
Viewing files alias.
cat View the content of a text file one page a time.
|| Run a command only if the previous one fails. Example: unalias Remove alias.
ping 127.0.0.1 || echo "Server down"). cat [file1] [file2] Concatenate files.
$() Use the output of a command into another command. cat [file 1] [file2] > [file3] Concatenate files to another file. Monitoring system resources
Example: mkdir$(date "+%Y-%m-%d") less Scroll through a content of a text file. Press Q when done. ps aux View all currently running processes.
| Use the output of one command as input for another. head View the first 10 line of a file. ps axjf View a process tree.
Example: ls -l | less tail View the last 10 lines of a file. top View a dynamically updated list of the currently running
ls Redirect a command’s output to a file. Example: ls -lF > processes (sorted by cpu usage).
listing.txt Archiving and compression free Show memory usage (in kilobytes).
>> Append a command’s output to a file.Example: ls -lF >> zip Compress files or directories using zip. free -m Show memory usage in megabytes.
listing.txt zip [0-9] Choose a compression level. df Show disk usage.
< Use a file as input for a command. Example: echo < zip -e Encrypt the contents of a zip file. df -h Show disk usage in human-readable form.
listing.txt
unzip Unzip files. du Show disk space used by a directory.
Working with files and directories tar -cf Archive files with tar. du -h Show disk space in human-readable form.
pwd Display the name of the current directory. tar -zcvf Archive and compress files with tar and gzip.
touch [file] Change the date/time stamp of the file to the tar -zxvf Untar and uncompress files.
current time. Create an empty file if the file does not exist.
ls List the content of the current directory. Finding files
locate [text] Find the file, name of which contains the string
ls --color Display contents in color
text.
ls -a View hidden files and folders.
locate -i Find ignoring case.

The latest version of the cheat sheet is available at www.nothickmanuals.info/doku.php/cheatsheets | © 2007 www.nothickmanuals.info | Released under the GNU Free Documentation License

Anda mungkin juga menyukai