Linux command-line Cheat Sheet

Reviews
V0.3 (April 2009) Linux command-line Cheat Sheet Compress and archive Useful tools for compressing and archive files. cvf filename.tar files xvf filename.tar cvfz filename.tgz files xvfz filename.tgz files Archive Unarchive Arch+Compress Uncompress Compress Decompress Compress Decompress Environment Verify and set the environment variables in BASH. Network Miscellaneous commands for networking. List all active interfaces export VAR=content env echo $PATH $HOME $SHELL Store the variable with content Display environment vars Display path where commands are located. Location of the home dir Shell in use tar tar bzip2 ifconfig eth0 eth0 up eth0 1.1.1.1 Display information about eth0 interface. Brings up eth0. Give a static IP to eth0. List all routes. Send a packet to hostname machine. List all open ports and conections in and out of the machine. List process that is listening in port 80. Establish a secure shell to server Copy file to remote location “/” in server 1.1.1.1 as “user”. bunzip2 finaname.bz2 zip unzip files filename.zip filename.zip route ping netstat lsof -n hostname $LD_LIBRARY Directory with dynamic _PATH shared libraries. $DISPLAY To which display applications should be sent Set a new alias Show language settings Where alias and environment vars can be stored to persist -a alias locale newalias=cmd -i:80 server ~/.bashrc ~/.bash_profile Redirection Redirect input (stdin), errors (stderr) and output (stdout) between files and applications. ssh scp file user@1.1.1.1:/ echo msg > file1 Redirect stdout to file1 Redirect stderr to file1 Redirect both stdout and stderr to file Redirect file1 content into stdin of myprog Redirect stdout to myprog Configuring the system Command line applications provided by distributions to configure the system. echo msg 2> file1 myprog &> file1 myprog < file1 echo msg | myprog Session Useful shortcuts and commands for advanced session management. d Exit from the command line. Freezes stdout. Unfreezes stdout. Look backward in command history Complete the prompt with the last matching command in history The next matching command. Launch screen. s q r drakconf (?) (?) yast2 (?) Mandriva, Caixa Mágica Debian, Ubuntu Fedora OpenSuSE Control + Locating files Files and directories Commands for managing files and directories Commands for managing files and directories. Page Up Down whereis command locate -i file ls cp mv cat rm -al file1 dir2/ file1 dir2/ file1 file1 List files Copy file to directory dir2/ Move file / rename file Show content of a text file1 Delete file1 Create directory Change into directory Where in $PATH is command Locate file in disk (-i = not case sensitive). Requires updatedb before. Updates the database of existent files and directories. screen (Ctrl-A d) -r Dettach session. Reattach a previous session. updatedb / -name file Help If none of the above works for you, try this. mkdir dir cd dir find find Finds recursively starting in location “/” the file with the given name. man command 1 command -k string . -exec ls {} \; Executes command “ls” over each entry of find result Get information about command. Get section 1 of command man page. List all commands with “string” in the description . Display documentation in info format for command. System status & Users Get information about system and manage users. Parsing Commands for parsing files and messages. pattern file Prints line where pattern occur in file. Use extend regexp. Use Perl regexp. Print field 2 of each line of file (space separated). Sends to stdout the content of file1 replacing str1 by str2. info command ps pstree top free df vmstat uname -aux List processes. List processes as a tree. Sort processes by CPU (or RAM). Check free memory and swap. grep -E ext_regexp file -P Perl_regexp file -h -d -a Show disk space in active partitions. Display virtual memory, CPU and IO statistics Show info about Kernel & hw. Add an user, copy skel. Delete an user. awk sed '{print $2}' file Get updates of this Linux command-line Cheat Sheet in: http://paulotrezentos.polo-sul.org/cheatsheet/ Paulo.Trezentos@iscte.pt Paulo.Trezentos@caixamagica.pt This cheat sheet is under: s/str1/str2 file1 useradd -m user userdel user

Related docs
Linux Command Line Cheat-Sheet
Views: 205  |  Downloads: 33
Command Line Cheat Sheet
Views: 123  |  Downloads: 10
Linux Command Line Cheat-sheet for Web Developers
Views: 203  |  Downloads: 18
Unix command line command cheat sheet
Views: 274  |  Downloads: 57
Unix command line command cheat sheet
Views: 112  |  Downloads: 19
Linux Cheat Sheet
Views: 55  |  Downloads: 13
Linux Cheat Sheet Contents
Views: 339  |  Downloads: 25
Linux Cheat Sheet Cygwin on Windows
Views: 19  |  Downloads: 0
premium docs
Other docs by elitecx764
cr100
Views: 166  |  Downloads: 0
Western Union v Hill
Views: 567  |  Downloads: 2
Grey Literature and Urban Planning
Views: 386  |  Downloads: 6
I See the Lord
Views: 320  |  Downloads: 0
General forms
Views: 283  |  Downloads: 2
adr105
Views: 114  |  Downloads: 0
at125
Views: 142  |  Downloads: 0
Mechanice Engineering Overview
Views: 608  |  Downloads: 27
Entrepreneurship Outline for Final
Views: 450  |  Downloads: 12
Oxendine v State
Views: 434  |  Downloads: 4
Hear O Israel
Views: 245  |  Downloads: 0
Checklist - Contracts
Views: 534  |  Downloads: 28
Lamb of God
Views: 212  |  Downloads: 2
Baker v Weeden
Views: 335  |  Downloads: 3
Vick
Views: 160  |  Downloads: 0