<<

Quick Reference Linux Quick Reference Linux Quick Reference SOME USEFUL COMMANDS SOME USEFUL COMMANDS SOME USEFUL COMMANDS

Command Task Task Command Task Command Task Command Task Command Task / Basics File Location File/Directory Basics File Location File/Directory Basics File Location List files files ls List files find Locate files ls List files find Locate files Copy files slocate Locate files via index cp Copy files slocate Locate files via index cp Copy files slocate Locate files via index Rename files Locate commands mv Rename files which Locate commands mv Rename files which Locate commands Delete files Locate standard files rm Delete files whereis Locate standard files rm Delete files whereis Locate standard files files ln Link files ln Link files File Text Manipulation File Text Manipulation File Text Manipulation Change directory cd Change directory cd Change directory Search text for matching grep Search text for matching grep Search text for matching Print current directory lines pwd Print current directory lines pwd Print current directory lines name name name Extract columns cut Extract columns cut Extract columns Create directory mkdir Create directory mkdir Create directory Append columns paste Append columns paste Append columns Delete directory rmdir Delete directory rmdir Delete directory Translate characters tr Translate characters tr Translate characters File Viewing Sort lines File Viewing sort Sort lines File Viewing sort Sort lines View files Locate identical lines cat View files uniq Locate identical lines cat View files uniq Locate identical lines Page through files Copy stdin to a file and less Page through files tee Copy stdin to a file and less Page through files tee Copy stdin to a file and View file beginning to stdout simultaneously head View file beginning to stdout simultaneously head View file beginning to stdout simultaneously View file ending File Compression tail View file ending File Compression tail View file ending File Compression Number lines Compress files nl Number lines gzip Compress files nl Number lines gzip Compress files View binary data (GNU Zip) od View binary data (GNU Zip) od View binary data (GNU Zip) xxd View binary data compress Compress files (Unix) xxd View binary data compress Compress files (Unix) xxd View binary data compress Compress files (Unix) gv View Postscript/PDF files Compress files (BZip2) gv View Postscript/PDF files bzip2 Compress files (BZip2) gv View Postscript/PDF files bzip2 Compress files (BZip2) xdvi View TeX DVI files zip Compress files xdvi View TeX DVI files zip Compress files xdvi View TeX DVI files zip Compress files (Windows Zip) (Windows Zip) (Windows Zip) File Creation and Editing File Creation and Editing File Creation and Editing emacs File Comparison emacs Text editor File Comparison emacs Text editor File Comparison vim Text editor Compare files line by line vim Text editor diff Compare files line by line vim Text editor diff Compare files line by line Set default file Compare sorted files umask Set default file comm Compare sorted files umask Set default file comm Compare sorted files protections Compare files byte protections cmp Compare files byte protections cmp Compare files byte soffice Edit Word/Excel/ by byte soffice Edit Word/Excel/ by byte soffice Edit Word/Excel/ by byte PowerPoint docs Compute checksums PowerPoint docs md5sum Compute checksums PowerPoint docs md5sum Compute checksums Edit Word documents abiword Edit Word documents abiword Edit Word documents Disks and Filesystems Disks and Filesystems Disks and Filesystems gnumeric Edit Excel documents gnumeric Edit Excel documents gnumeric Edit Excel documents Show free disk space df Show free disk space df Show free disk space File Properties a disk accessible File Properties mount Make a disk accessible File Properties mount Make a disk accessible Display file attributes Check a disk for errors stat Display file attributes fsck Check a disk for errors stat Display file attributes fsck Check a disk for errors Count bytes/words/lines Flush disk caches wc Count bytes/words/lines sync Flush disk caches wc Count bytes/words/lines sync Flush disk caches Measure disk usage du Measure disk usage du Measure disk usage and Remote Storage Backups and Remote Storage Backups and Remote Storage file Identify file types file Identify file types file Identify file types mt Control a tape drive mt Control a tape drive mt Control a tape drive Change file timestamps touch Change file timestamps touch Change file timestamps Back up a disk dump Back up a disk dump Back up a disk Change file owner chown Change file owner chown Change file owner restore Restore a dump restore Restore a dump restore Restore a dump Change file group chgrp Change file group chgrp Change file group Read/ tape archives tar Read/write tape archives tar Read/write tape archives Change file protections chmod Change file protections chmod Change file protections cdrecord Burn a CD cdrecord Burn a CD cdrecord Burn a CD Change advanced file chattr Change advanced file chattr Change advanced file attributes Mirror a set of files attributes rsync Mirror a set of files attributes rsync Mirror a set of files lsattr List advanced file lsattr List advanced file lsattr List advanced file attributes attributes attributes

©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- ©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- ©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- tered trademark of O’Reilly & Associates, Inc. All other tered trademark of O’Reilly & Associates, Inc. All other tered trademark of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473 www.oreilly.com trademarks are property of their respective owners. #30473 www.oreilly.com trademarks are property of their respective owners. #30473 www.oreilly.com Linux Quick Reference Linux Quick Reference Linux Quick Reference SOME USEFUL COMMANDS SOME USEFUL COMMANDS SOME USEFUL COMMANDS

Command Task Command Task Command Task Command Task Command Task Command Task File/Directory Basics File Location File/Directory Basics File Location File/Directory Basics File Location ls List files find Locate files ls List files find Locate files ls List files find Locate files cp Copy files slocate Locate files via index cp Copy files slocate Locate files via index cp Copy files slocate Locate files via index mv Rename files which Locate commands mv Rename files which Locate commands mv Rename files which Locate commands rm Delete files whereis Locate standard files rm Delete files whereis Locate standard files rm Delete files whereis Locate standard files ln Link files ln Link files ln Link files File Text Manipulation File Text Manipulation File Text Manipulation cd Change directory cd Change directory cd Change directory grep Search text for matching grep Search text for matching grep Search text for matching pwd Print current directory lines pwd Print current directory lines pwd Print current directory lines name name name cut Extract columns cut Extract columns cut Extract columns mkdir Create directory mkdir Create directory mkdir Create directory paste Append columns paste Append columns paste Append columns rmdir Delete directory rmdir Delete directory rmdir Delete directory tr Translate characters tr Translate characters tr Translate characters File Viewing sort Sort lines File Viewing sort Sort lines File Viewing sort Sort lines cat View files uniq Locate identical lines cat View files uniq Locate identical lines cat View files uniq Locate identical lines less Page through files tee Copy stdin to a file and less Page through files tee Copy stdin to a file and less Page through files tee Copy stdin to a file and head View file beginning to stdout simultaneously head View file beginning to stdout simultaneously head View file beginning to stdout simultaneously tail View file ending File Compression tail View file ending File Compression tail View file ending File Compression nl Number lines gzip Compress files nl Number lines gzip Compress files nl Number lines gzip Compress files od View binary data (GNU Zip) od View binary data (GNU Zip) od View binary data (GNU Zip) xxd View binary data compress Compress files (Unix) xxd View binary data compress Compress files (Unix) xxd View binary data compress Compress files (Unix) gv View Postscript/PDF files bzip2 Compress files (BZip2) gv View Postscript/PDF files bzip2 Compress files (BZip2) gv View Postscript/PDF files bzip2 Compress files (BZip2) xdvi View TeX DVI files zip Compress files xdvi View TeX DVI files zip Compress files xdvi View TeX DVI files zip Compress files (Windows Zip) (Windows Zip) (Windows Zip) File Creation and Editing File Creation and Editing File Creation and Editing emacs Text editor File Comparison emacs Text editor File Comparison emacs Text editor File Comparison vim Text editor diff Compare files line by line vim Text editor diff Compare files line by line vim Text editor diff Compare files line by line umask Set default file comm Compare sorted files umask Set default file comm Compare sorted files umask Set default file comm Compare sorted files protections cmp Compare files byte protections cmp Compare files byte protections cmp Compare files byte soffice Edit Word/Excel/ by byte soffice Edit Word/Excel/ by byte soffice Edit Word/Excel/ by byte PowerPoint docs md5sum Compute checksums PowerPoint docs md5sum Compute checksums PowerPoint docs md5sum Compute checksums abiword Edit Word documents abiword Edit Word documents abiword Edit Word documents Disks and Filesystems Disks and Filesystems Disks and Filesystems gnumeric Edit Excel documents gnumeric Edit Excel documents gnumeric Edit Excel documents df Show free disk space df Show free disk space df Show free disk space File Properties mount Make a disk accessible File Properties mount Make a disk accessible File Properties mount Make a disk accessible stat Display file attributes fsck Check a disk for errors stat Display file attributes fsck Check a disk for errors stat Display file attributes fsck Check a disk for errors wc Count bytes/words/lines sync Flush disk caches wc Count bytes/words/lines sync Flush disk caches wc Count bytes/words/lines sync Flush disk caches du Measure disk usage du Measure disk usage du Measure disk usage Backups and Remote Storage Backups and Remote Storage Backups and Remote Storage file Identify file types file Identify file types file Identify file types mt Control a tape drive mt Control a tape drive mt Control a tape drive touch Change file timestamps touch Change file timestamps touch Change file timestamps dump Back up a disk dump Back up a disk dump Back up a disk chown Change file owner chown Change file owner chown Change file owner restore Restore a dump restore Restore a dump restore Restore a dump chgrp Change file group chgrp Change file group chgrp Change file group tar Read/write tape archives tar Read/write tape archives tar Read/write tape archives chmod Change file protections chmod Change file protections chmod Change file protections cdrecord Burn a CD cdrecord Burn a CD cdrecord Burn a CD chattr Change advanced file chattr Change advanced file chattr Change advanced file attributes rsync Mirror a set of files attributes rsync Mirror a set of files attributes rsync Mirror a set of files lsattr List advanced file lsattr List advanced file lsattr List advanced file attributes attributes attributes

©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- ©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- ©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- tered trademark of O’Reilly & Associates, Inc. All other tered trademark of O’Reilly & Associates, Inc. All other tered trademark of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473 www.oreilly.com trademarks are property of their respective owners. #30473 www.oreilly.com trademarks are property of their respective owners. #30473 www.oreilly.com Linux Quick Reference Linux Quick Reference Linux Quick Reference SOME USEFUL COMMANDS SOME USEFUL COMMANDS SOME USEFUL COMMANDS

Command Task Command Task Command Task Command Task Command Task Command Task Printing Networking Printing Networking Printing Networking lpr Print files ssh Securely log into remote lpr Print files ssh Securely log into remote lpr Print files ssh Securely log into remote lpq View print queue hosts lpq View print queue hosts lpq View print queue hosts lprm Remove print jobs telnet Log into remote hosts lprm Remove print jobs telnet Log into remote hosts lprm Remove print jobs telnet Log into remote hosts scp Securely copy files scp Securely copy files scp Securely copy files Spelling Operations between hosts Spelling Operations between hosts Spelling Operations between hosts look Look up spelling sftp Securely copy files look Look up spelling sftp Securely copy files look Look up spelling sftp Securely copy files between hosts between hosts between hosts aspell Check spelling aspell Check spelling aspell Check spelling interactively ftp Copy files between hosts interactively ftp Copy files between hosts interactively ftp Copy files between hosts Check spelling in batch evolution GUI email client spell Check spelling in batch evolution GUI email client spell Check spelling in batch evolution GUI email client mutt Text-based email client mutt Text-based email client mutt Text-based email client Processes Minimal email client Processes mail Minimal email client Processes mail Minimal email client List all processes List all processes List all processes mozilla Web browser ps mozilla Web browser ps mozilla Web browser List users’ processes List users’ processes List users’ processes lynx Text-only web browser w lynx Text-only web browser w lynx Text-only web browser View the system load View the system load View the system load wget Retrieve web pages uptime wget Retrieve web pages uptime wget Retrieve web pages Monitor processes to disk top Monitor processes to disk top Monitor processes to disk xload Monitor system load slrn Read Usenet news xload Monitor system load slrn Read Usenet news xload Monitor system load slrn Read Usenet news free Display free memory gaim /IRC free Display free memory gaim Instant messaging/IRC free Display free memory gaim Instant messaging/IRC Terminate processes Linux/Unix chat kill Terminate processes talk Linux/Unix chat kill Terminate processes talk Linux/Unix chat Set priorities write Send messages to nice Set process priorities write Send messages to nice Set process priorities write Send messages to renice Change process priorities a terminal renice Change process priorities a terminal renice Change process priorities a terminal Prohibit talk/write mesg Prohibit talk/write mesg Prohibit talk/write Scheduling Jobs Scheduling Jobs Scheduling Jobs for some Audio and Video sleep Wait for some time Audio and Video sleep Wait for some time Audio and Video Run programs set Play CDs and rip MP3s watch Run programs at set grip Play CDs and rip MP3s watch Run programs at set grip Play CDs and rip MP3s intervals Play audio files intervals xmms Play audio files intervals xmms Play audio files at Schedule a job cdparanoia Rip audio at Schedule a job cdparanoia Rip audio at Schedule a job cdparanoia Rip audio crontab Schedule repeated jobs audacity Edit audio crontab Schedule repeated jobs audacity Edit audio crontab Schedule repeated jobs audacity Edit audio xcdroast Burn CDs xcdroast Burn CDs xcdroast Burn CDs Hosts Hosts Hosts Print system information uname Print system information uname Print system information hostname Print the system’s hostname Print the system’s hostname Print the system’s hostname hostname hostname Set/display network ifconfig Set/display network ifconfig Set/display network information information information Look up DNS host Look up DNS host Look up DNS whois Look up domain whois Look up domain whois Look up domain registrants registrants registrants ping Check if host is reachable ping Check if host is reachable ping Check if host is reachable View network path to traceroute View network path to traceroute View network path to a host a host a host

www.oreilly.com www.oreilly.com www.oreilly.com

Excerpted from Linux Pocket Reference Excerpted from Linux Pocket Reference Excerpted from Linux Pocket Reference