<<

Linux Cheat Sheet Share This Cheat Sheet

Basic commands management File Utilities Memory & Processes

| Pipe (redirect) output find search for a file -d translate or delete character free -m display free and used system memory [command] run < command> in -a - -h list content of -c -u report or omit repeated lines mode stop all process by name -r -f remove files and directory -l split file into pieces [command] run < command> immune to sensors CPU temperature hangup -i find file, using updatedb(8) - newline, word, and byte database counts for each file display current processes, real man [command] display pages of monitoring < command> -a -R -i files or directory -n output the first part of files -1 -9 send signal to process [command] & run < command> and send task -s disk usage -s remove section from file to background service manage or run sysV init script file -b -i identify the file diff -q file compare, line by line [|stop|restart] >> [fileA] append to fileA, preserving existing contents -f -i files or directory -i join lines of two files on a aux display current processes, common field snapshot > [fileA] output to fileA, overwriting , egrep, fgrep -i -v print lines matching pattern contents , view file content, one page a dmesg -k display system messages time -n display a line of text -n sort lines in text file build command line from File compression previous output -3 compare two sorted files, line Disk Utilities xvfz create or extract .tar or .tgz by line 1>2& Redirect stdout to stderr files -h, -i usage -s concatenate files to the fg %N go to task N standard output gzip, gunzip, zcat create, extract or view .gz files -t -V create file system jobs list task -f output last part of the file uuencode, uudecode create or extract .Z files resize2fs update a filesystem, after lvextend* ctrl-z suspend current task zip, unzip -v create or extract .ZIP files -A -N file system check & repair rpm create or extract .rpm files Scripting pvcreate create physical volume bzip2, bunzip2 create or extract .bz2 files File permission , gawk pattern scanning -a -t mount a filesystem rar create or extract .rar files -c -R chmod file read, and tsh tiny shell -l edit disk partition executable permission " " anything within double quotes lvcreate create a logical volume -a -t modify (or create) file timestamp File Editor is unchanged except \ and $ umount -f -v umount a filesystem -c -R change file ownership ' ' anything within single quote is basic editor unchanged -c -R change file group permission visual editor python "object-oriented programming touch -a -t modify (or create) file language" Misc Commands timestamp nano pico clone GNU bourne-again SHell view view file only -P print current working directory ksh korn shell emacs extensible, customizable editor bc high precision calculator Network php general-purpose scripting sublime yet another text editor language evaluate expression

-r -v print network information, stream editor csh, tcsh C shell print calender routing and connections pico simple editor Practical Extraction and Report export assign or remove environment telnet user interface to the TELNET Language variable protocol source [file] load any functions file into the ` [command] backquote, execute command tcpdump network traffic Directory Utilities current shell, requires the file to be executable date -d print formatted date ssh -i openSSH client create a directory $[variable] if set, access the variable ping -c print routing packet trace to network remove a directory Read the Blog Post » Compiled by Alvin Khoo bit.ly/-Commands