Docsity

Linux/Unix Command Reference Card - Prof. Andrew R. Dalton, Study notes of Operating Systems

Toggle sidebar
bg1
Linux/Unix Reference Card
Basic File and Directory Manipulation
pwd ...........................Print working directory
cd...................................Change directory
ls .............................List directory contents
cp ..........................................Copy files
mv..................................Move/rename files
rm .......................................Remove files
ln...........................................Link files
mc .........................Command-line file browser
mkdir .................................Make directory
rmdir ...............................Remove directory
umask ................Get/set file mo de creation mask
shred ............................Destroy data in files
File Viewing
cat ..............Concatenate files and print to stdout
less ............................... Page through files
wc....................Count lines, words, bytes in files
nl ............................... Number lines of files
od ...............Prints file in octal and other formats
head .................. View the first few lines of a file
tail ...................View the last few lines of a file
File Text Manipulation
grep ................Search text for matching patterns
cut.............Remove sections from each line of files
paste ..............................Merge lines of files
tr ...................... Translate or delete characters
join ..............Join lines of files on a common field
split .............................Split file into pieces
csplit ......... Split file into sections by context lines
sort ........................................Sort lines
uniq ...........Remove duplicate lines from sorted file
fmt .....................Simple optimal text formatter
printf.........................Format and print data
tee ...........................Write to stdout and file
Backups and Remote Storage
tar ............Read/write (compressed) tape archives
rsync .............................Mirror a set of files
File Properties
stat................................Display file status
wc ...........................Count bytes/words/lines
du ................................Estimate disk usage
file ........................Manipulate file attributes
touch .........................Change file timestamps
chown .............................. Change file owner
chgrp...............................Change file group
chmod .........................Change file protections
readlink .............Display value of a symbolic link
basename.....Strip directory and suffix from filenames
dirname . . . . . . Strip non-directory suffix from filenames
File and Command Location and Help
find ......................................Locate files
locate ..........................Locate files via index
which ..............................Locate commands
apropos.........Locate commands by keyword lookup
man .................Find and display online help page
info ................Find and display online help page
whereis . . . Locate bin, src and man files for command
wtf.......................Translates acronyms for you
File Compression
gzip ...............Compress/decompress files (LZ77)
bzip2 ..............Compress/decompress files (BWT)
[un]zip ..... (De-)Compress files (PKZIP compatible)
[un]rar.....................(De-)Compress RAR files
7z .........................(De-)Compress files (7-Zip)
jar . . . Compress/decompress files (PKZIP compatible)
File Comparison and Patching
diff ........................Compare files line-by-line
vimdiff ....................Compare files side-by-side
patch ...................Apply changes from a diff file
comm .............................Compare sorted files
cmp ........................Compare files byte by byte
md5sum.......Compute and check MD5 message digest
Disks and Filesystems
df ...............................Show free disk space
mount ..........................Make a disk accessible
fcsk ...........................Check a disk for errors
sync ..........Synchronizes filesystem buffers and disk
Environment
env .....................Display environment variables
echo ....................................Print variable
export ............Write environment variables (Bash)
set . . . . Write environment variables with more options
unset ....................Unset environment variables
Scheduling Jobs
sleep .........................Delay for specified time
watch ...................Run programs at set intervals
at .....................................Schedule a job
cron ...................................Clock daemon
crontab ...............Schedule repeated jobs for cron
Processes
ps ...................................List all processes
pstree .....................Display a tree of processes
uptime ...........................View system uptime
top .................................Monitor processes
htop ........................Interactive process viewer
kill ............................. Terminate processes
nice ...............Run process with modified priority
renice .................Alter running process’ priority
time ................................Time a command
Users and Groups
finger ...............Display information about users
w...........Who’s logged in and what are they doing?
who ................................. Who’s logged in?
users ..............List user names of who’s logged in
whoami ....................................Who am I?
groups ..................What groups am I a part of ?
id ................................Print user’s identify
passwd ....................... Change user’s password
chfn .......................Change user’s information
chsh .......................Change user’s default shell
pf2

Partial preview of the text

Download Linux/Unix Command Reference Card - Prof. Andrew R. Dalton and more Study notes Operating Systems in PDF only on Docsity!

Linux/Unix Reference Card

Basic File and Directory Manipulation

pwd........................... Print working directory cd................................... Change directory ls............................. List directory contents cp.......................................... Copy files mv................................. .Move/rename files rm....................................... Remove files ln.......................................... .Link files mc......................... Command-line file browser mkdir................................. Make directory rmdir............................... Remove directory umask................ Get/set file mode creation mask shred............................ Destroy data in files

File Viewing

cat.............. Concatenate files and print to stdout less............................... Page through files wc.................... Count lines, words, bytes in files nl............................... Number lines of files od............... Prints file in octal and other formats head.................. View the first few lines of a file tail................... View the last few lines of a file

File Text Manipulation

grep................ Search text for matching patterns cut............ .Remove sections from each line of files paste.............................. Merge lines of files tr...................... Translate or delete characters join.............. Join lines of files on a common field split............................. Split file into pieces csplit......... Split file into sections by context lines sort........................................ Sort lines uniq........... Remove duplicate lines from sorted file fmt..................... Simple optimal text formatter printf......................... Format and print data tee........................... Write to stdout and file

Backups and Remote Storage

tar............ Read/write (compressed) tape archives rsync............................. Mirror a set of files

File Properties

stat............................... .Display file status wc........................... Count bytes/words/lines du................................ Estimate disk usage file........................ Manipulate file attributes touch......................... Change file timestamps chown.............................. Change file owner chgrp............................... Change file group chmod......................... Change file protections readlink............. Display value of a symbolic link basename..... Strip directory and suffix from filenames dirname...... Strip non-directory suffix from filenames

File and Command Location and Help

find...................................... Locate files locate.......................... Locate files via index which.............................. Locate commands apropos........ .Locate commands by keyword lookup man................. Find and display online help page info................ Find and display online help page whereis... Locate bin, src and man files for command wtf...................... .Translates acronyms for you

File Compression

gzip............... Compress/decompress files (LZ77) bzip2.............. Compress/decompress files (BWT) [un]zip..... (De-)Compress files (PKZIP compatible) [un]rar..................... (De-)Compress RAR files 7z......................... (De-)Compress files (7-Zip) jar... Compress/decompress files (PKZIP compatible)

File Comparison and Patching

diff........................ Compare files line-by-line vimdiff.................... Compare files side-by-side patch................... Apply changes from a diff file comm............................. Compare sorted files cmp........................ Compare files byte by byte md5sum...... .Compute and check MD5 message digest

Disks and Filesystems

df............................... Show free disk space mount.......................... Make a disk accessible fcsk........................... Check a disk for errors sync.......... Synchronizes filesystem buffers and disk

Environment

env..................... Display environment variables echo.................................... Print variable export............ Write environment variables (Bash) set.... Write environment variables with more options unset.................... Unset environment variables

Scheduling Jobs

sleep......................... Delay for specified time watch................... Run programs at set intervals at..................................... Schedule a job cron................................... Clock daemon crontab............... Schedule repeated jobs for cron

Processes

ps................................... List all processes pstree..................... Display a tree of processes uptime........................... View system uptime top................................. Monitor processes htop........................ Interactive process viewer kill............................. Terminate processes nice............... Run process with modified priority renice................. Alter running process’ priority time................................ Time a command

Users and Groups

finger............... Display information about users w........... Who’s logged in and what are they doing? who................................. Who’s logged in? users.............. List user names of who’s logged in whoami.................................... Who am I? groups.................. What groups am I a part of? id................................ Print user’s identify passwd....................... Change user’s password chfn....................... Change user’s information chsh....................... Change user’s default shell

Printing

enscript.............. Convert text files to PostScript lpq................................. View print queue lprm............................... Remove print jobs

Hosts

uname....................... Print system information hostname................ Print the system’s hostname ifconfig............ .Set/display network information host.................................... Look up DNS whois..................... Look up domain registrants ping... Check reachability and response time of a host traceroute.............. View network path to a host dig................................ DNS lookup utility

File Editing

vim....................................... Text editor view........................... vim in read-only mode gvim........................... A GUI version of Vim emacs..................................... Text editor nano............................... Simple text editor sed................................ Stream text editor

Spelling Operations

ispell.................... Check spelling interactively aspell....................... Interactive spell checker look................................. Look up spelling

Networking

ssh..................... Securely log into remote hosts scp.................. Securely copy files between hosts sftp................. Securely copy files between hosts wget............................ Retrieve a url to disk talk................................ Linux/Unix Chat write.................... Send messages to a terminal mesg....................... Enable/prohibit talk/write who............................ .Show who is logged in last............ Displays login and logout information

Email, News and Web Browsing

pine......... Terminal-based email and news program mutt................... Terminal-based email program mail.............................. Minimal mail client links.......................... Text-only web browser lynx........................... Text-only web browser firefox............................ GUI web browser

Text Processors and Viewers

latex................... Compiles LaTeX → TeX DVI pdflatex................... .Compiles LaTeX → PDF bibtex......................... Compiles BiBTeX files gv.......................... View Postscript/PDF files xdvi.............................. View TeX DVI files dvips.................. .Prints/converts TeX DVI files ps2pdf................... Converts Postscript → PDF

Image Manipulation/Display

xv................................. Image viewer for X display.................. ImageMagick: display image convert................. ImageMagick: convert image identify........ ImageMagick: display file image info import... .ImageMagick: save screen/window as image compare............... ImageMagick: compare images xfig.......................... Tool for drawing figures dia........................... Tool for drawing figures inkscape...... Scalable Vector Graphics (SVG) editor gimp............... GNU image manipulation program

Source Code Management

svn................. Subversion version control system cvs....................... Concurrent versions system rcs........................... Revision control system

Miscellaneous

alias........ Create shorthand for a series commands su........... Allows you to run a shell as another user sudo..... Lets you execute a command as another user nohup............ Lets a program run after you log out screen....... Screen manager with terminal emulation date.................. Print the system date and time

Development

make.................... Utility to (re-)build programs cscope............ Interactively examine a C program gcc.................................. Compiles C code g++.............................. Compiles C++ code gdb......................... Debugger for C and C++ splint................... Statically check C programs javac............................. Compiles Java code jdb................................ Debugger for Java ddd..................... GUI front-end to gdb and jdb ant.......................... Make-like utility for Java awk......... Pattern scanning and processing language perl...................... Perl programming language python................ Python programming language ruby..................... Ruby programming language

Mathematics

bc.......... An arbitrary precision calculator language expr............................. Evaluate expressions calc.................... Calculator with C-like syntax octave...... An interactive language for computations gnuplot.............. An interactive plotting program R.............................. Data analysis language This card may be freely distributed under the terms of the GNU general public license — This document was compiled by Andrew R. Dalton 〈2009-1-07〉 — v0.1 — The author assumes no re- sponsibility for any errors on this card. This reference card was adapted from Thiam H Lee, found at http://www.columbia.edu/~thl2102/.