Useful Unix Commands Sorted Into Groups # directory manipulation: ls (ll) - list directory contents dir - list directory contents vdir - list directory contents dircolors - color setup for ls cd - change current/working directory pwd - print name of current/working directory mkdir - make directories rmdir - remove empty directories namei - follow a pathname until a terminal point is found dirs - displays the list of currently remembered directories pushd - adds a directory to the top of the directory stack popd - removes entries from the directory stack pathchk - check whether file names are valid or portable # file manipulation: cp - copy files and/or directories install - copy files and set attributes mv - move/rename files rename - rename files basename - strip directory and suffix from filenames dirname - strip non-directory suffix from file name rm - remove files or directories shred - delete a file securely, first overwriting it to hide its contents ln - make links between files link - call the link function to create a link to a file unlink - call the unlink function to remove the specified file readlink - print contents of symbolic link alternatives - maintain symbolic links determining default commands file - determine file type touch - change file timestamps chattr - change file attributes on a Linux second extended file system lsattr - list file attributes on a Linux second extended file system mkfifo - make FIFOs (named pipes) mknod - make block or character special files mktemp - make temporary file name (unique) # access rights/owner chown - change file owner and group chgrp - change group ownership chmod - change file access permissions access - determine whether a file can be accessed chacl - change the access control list of a file or directory setfacl - set file access control lists setfattr - set extended attributes of filesystem objects umask - set the user file creation mask whoami - print effective userid groups - print the groups a user is in id - print real and effective UIDs and GIDs logname - print user´s login name chfn - change your finger information chsh - change your login shell # search for files/content find - search for files in a directory hierarchy which - shows the full path of (shell) commands type - shows the full path of (shell) commands (bash only) where - shows the full path of (shell) commands (tcsh only) whereis - locate the binary, source, and manual page files for a command grep, egrep, fgrep - print lines matching a pattern (string) look - display lines beginning with a given string xargs - build and execute command lines from standard input # compare files test - check file types and compare values cmp - compare two files comm - compare two sorted files line by line diff - find differences between two files diff3 - find differences between three files diffstat - make histogram from diff-output pdiff - produce a pretty comparison between files sdiff - find differences between two files and merge interactively rediff, editdiff - fix offsets and counts of a hand-edited diff sum - checksum and count the blocks in a file cksum - checksum and count the bytes in a file md5sum - compute and check MD5 message digest sha1sum - compute and check SHA1 message digest ptx - produce a permuted index of file contents fam - file alteration monitor gendiff - utility to aid in error-free diff file generation lsdiff - show which files are modified by a patch splitdiff - separate out incremental patches patch - apply a diff file to an original newer - compare file modification times # show file contents cat - concatenate files and print on the standard output tac - concatenate and print files in reverse more - file perusal filter for crt viewing less - file perusal filter for crt viewing head - output the first part of files tail - output the last part of files column - columnate lists hexdump - ascii, decimal, hexadecimal, octal dump xxd - make a hexdump or do the reverse od - dump files in octal and other formats pr - convert text files for printing wc - print the number of bytes, words, and lines in files nl - number lines of files printf - format and print data lv - a Powerful Multilingual File Viewer strings - print the strings of printable characters in files # modify files sort - sort lines of text files tsort - perform topological sort cssort - Czech sort uniq - remove duplicate lines from a sorted file split - split a file into pieces csplit - split a file into sections determined by context lines cut - remove sections from each line of files paste - merge lines of files join - join lines of two files on a common field merge - three-way file merge expand - convert tabs to spaces unexpand - convert spaces to tabs colrm - remove columns from a file rev - reverse lines of a file col - filter reverse line feeds from input ul - do underlining fmt - simple optimal text formatter fold - wrap each input line to fit in specified width join - join lines of two files on a common field paste - merge lines of files tr - translate or delete characters cstocs - charset encoding convertor for the Czech and Slovak languages enca - guess encoding of text files and convert them if required recode - convert files between various character sets and surfaces iconv - convert encoding of given files from one encoding to another unix2dos - UNIX to DOS text file format converter dos2unix - DOS/MAC to UNIX text file format converter # editors ed, red - text editor sed - a Stream EDitor awk, gawk - pattern scanning and processing language igawk - gawk with include files vi, vim - Vi IMproved, a programmers text editor vimdiff - edit two or three versions of a file with Vim and show differences vimtutor - the Vim tutor xxd - make a hexdump or do the reverse emacs - handle outline editing, compiling, running subshells, ... pico - simple text editor in the style of the Pine Composer makeindex - a general purpose, formatter-independent index processor aspell ispell pdffonts - Portable Document Format (PDF) font analyzer pdfimages - Portable Document Format (PDF) image extractor pdfinfo - Portable Document Format (PDF) document information extractor pdftotext - Portable Document Format (PDF) to text converter # compress files tar - the GNU version of the tar archiving utility gzip, gunzip, zcat - compress or expand files zgrep, zegrep, zfgrep - search possibly compressed files for a regular expression znew - recompress .Z files to .gz files zcmp, zdiff - compare compressed files zmore - file perusal filter for crt viewing of compressed text zless - file perusal filter for crt viewing of compressed text zforce - force a .gz extension on all gzip files gzexe - compress executable files in place bzip2, bunzip2 - a block-sorting file compressor bzip2recover - recovers data from damaged bzip2 files bzcat - decompresses files to stdout bzmore, bzless - file perusal filter for crt viewing of bzip2 compressed text bzcmp, bzdiff - compare bzip2 compressed files bzgrep, bzfgrep, bzegrep - search possibly bzip2 compressed files for a regular expression zip, zipcloak, zipnote, zipsplit - package and compress (archive) files unzip - list, test and extract compressed files in a ZIP archive funzip - filter for extracting from a ZIP archive in a pipe unzipsfx - self-extracting stub for prepending to ZIP archives zipgrep - search files in a ZIP archive for lines matching a pattern zipinfo - list detailed information about a ZIP archive cpio - copy files to and from archives lha unarj unrar ar - create, modify, and extract from archives pax - read and write file archives and copy directory hierarchies ranlib - generate index to archive # disk manipulation mount - mount a file system umount - unmount file systems eject - eject removable media sync - flush filesystem buffers dd - convert and copy a file df - report filesystem disk space usage isosize - outputs the length of a iso9660 file system du - estimate file space usage quota - display disk usage and limits edquota - edit user quotas repquota - summarize quotas for a filesystem setquota - set disk quotas warnquota - send mail to users over quota fdisk - partition table manipulator sfdisk - partition table manipulators ide_info - IDE device description tool badblocks - search a device for bad blocks fdformat - low-level formats a floppy disk setfdprm - sets user-provided floppy disk parameters hdparm - get/set hard disk parameters mkfs - build a Linux file system mkfs.minix - make a Linux MINIX filesystem mke2fs - create a Linux second extended file system fsck - check and repair a Linux file system e2fsck - check a Linux second extended file system debugfs - ext2 file system debugger dumpe2fs - dump filesystem information e2image - Save critical ext2 filesystem data to a file e2label - Change the label on an ext2 filesystem resize2fs - ext2 file system resizer tune2fs - adjust tunable filesystem parameters on second extended filesystems mklost+found - create a lost+found directory on a mounted Linux second extended file system mkswap - set up a Linux swap area swapon, swapoff - enable/disable devices and files for paging and swapping mt - control magnetic tape drive operation stinit - initialize SCSI magnetic tape drives mkisofs - create an hybrid ISO9660/JOLIET/HFS filesystem with optional Rock Ridge attributes devdump, isoinfo, isovfy, isodump - utility programs for dumping and verifying iso9660 images isosize - outputs the length of a iso9660 file system volname - return volume name minfo - print the parameters of a MSDOS filesystem updfstab - update /etc/fstab to reflect removable devices # shells sh - command interpreter (shell) ash - command interpreter (shell) bsh - command interpreter (shell) bash - GNU Bourne-Again SHell csh - C shell with file name completion and command line editing tcsh - C shell with file name completion and command line editing ksh zsk nash - script interpretor to interpret linuxrc images tclsh - Simple shell containing Tcl interpreter mc - Visual shell for Unix-like systems pilot - simple file system browser in the style of the Pine Composer dialog - display dialog boxes from shell scripts gdialog - display dialog boxes from shell scripts # system info w - show who is logged on and what they are doing who - show who is logged on whois, fwhois - query a whois or nicname database users - print the user names of users currently logged in to the current host last, lastb - show listing of last logged in users arch - print machine architecture kernelversion - program to report major version of kernel lsmod - list loaded modules modinfo - display information about a kernel module uname - print system information uptime - tell how long the system has been running ps - report process status pstree - display a tree of processes top - display top CPU processes tload - graphic representation of system load average skill, snice - report process status pidof - find the process ID of a running program free - display amount of free and used memory in the system fuser - identify processes using files or sockets runlevel - find the current and previous system runlevel dmesg - print or control the kernel ring buffer ipcs - provide information on ipc facilities readprofile - a tool to read kernel profiling information hostid - print the numeric identifier for the current host pinky - lightweight finger printenv - print all or part of environment tty - print the file name of the terminal connected to standard input consoletype - print type of the console connected to standard input script - make typescript of terminal session ldd - print shared library dependencies mev - a program to report mouse events sensors - printing sensors information showkey - examine the codes sent by the keyboard size - list section sizes and total size strace - trace system calls and signals vmstat - report virtual memory statistics # system control echo - output the arguments, separated by spaces, followed by a newline history - display the command history list with line numbers getopt - parse command options (enhanced) setsid - run a program in a new session watch - execute a program periodically, showing output fullscreen read - one line is read from the standard input bg - resume the suspended job in the background fg - resume job in the foreground and make it the current job jobs - list the active jobs disown - removes jobs from the table of active jobs nice - run a program with modified scheduling priority renice - alter priority of running processes kill - send a signal to the processes named by pid or jobspec killall - kill processes by name pgrep, pkill - look up or signal processes based on name and other attributes nohup - run a command immune to hangups, with output to a non-tty time - time a simple command or give resource usage times - print the accumulated user and system times for the shell ulimit - provides control over the resources available to the shell tzselect - select a time zone zic - time zone compiler ipcrm - remove a message queue, semaphore set or shared memory id setterm - set terminal attributes tunelp - set various parameters for the lp device env - run a program in a modified environment doexec - run an executable with an arbitrary argv[0] stty - change and print terminal line settings deallocvt - deallocate unused virtual consoles chvt - change foreground virtual terminal openvt - start a program on a new virtual terminal (VT) tset, reset - terminal initialization resizecons - change kernel idea of the console size screen - screen manager with VT100/ANSI terminal emulation gpm - a cut and paste utility and mouse server for virtual consoles mesg - control write access to your terminal hostname - show or set the system´s host name initlog - log messages and events to the system logger sys-unconfig - shell script to reconfigure the system upon next boot kbdconfig - simple interface for configuring system keyboard kbdrate - reset the keyboard repeat rate and delay time setkeycodes - load kernel scancode-to-keycode mapping table entries setleds - set the keyboard leds setmetamode - define the keyboard meta key handling setup - setup devices and file systems, mount root file system logwatch - system log analyzer and reporter logrotate - rotates, compresses, and mails system logs # system manipulation mingetty - minimal getty for consoles agetty - alternative Linux getty login - sign on logout - exit a login shell exit - cause the shell to exit su - run a shell with substitute user and group IDs sudo - execute a command as another user suexec - Switch User For Exec sulogin - single-user login nologin - politely refuse a login faillog - examine faillog and set login failure limits passwd - update a user´s authentication tokens(s) chpasswd - update password file in batch pwck - verify integrity of password files smbpasswd - change a user?s SMB password chage - change user password expiry information faillog - examine faillog and set login failure limits lastlog - examine lastlog file adduser, useradd - create a new user or update default new user information newusers - update and create new users in batch userdel - delete a user account and related files usermod - modify a user account pwck - verify integrity of password files groupadd - create a new group groupdel - delete a group groupmod - modify a group grpck - verify integrity of group files pwconv, pwunconv, grpconv, grpunconv - convert to and from shadow passwords and groups newgrp - log in to a new group gpasswd - administer the /etc/group file vipw, vigr - edit the password or group files visudo - edit the sudoers file init - process control initialization telinit - process control initialization ntsysv - simple interface for configuring runlevels chkconfig - updates and queries runlevel information for system services shutdown - bring the system down halt, reboot, poweroff - stop the system ctrlaltdel - set the function of the Ctrl-Alt-Del combination pivot_root - change the root file system chroot - run command or interactive shell with special root directory depmod - handle dependency descriptions for loadable kernel modules insmod - install loadable kernel module modprobe - high level handling of loadable modules rmmod - unload loadable modules raw - bind a Linux raw character device kudzu - detects and configures new and/or changed hardware on a system lockdev, liblockdev, dev_testlock, dev_lock, dev_relock, dev_unlock - manage device lockfiles tmpwatch - removes files which haven?t been accessed for a period of time # networking ifconfig - configure a network interface route - show / manipulate the IP routing table ethtool - display or change ethernet card settings ping, ping6 - send ICMP ECHO_REQUEST to network hosts traceroute - print the route packets take to network host tracepath, tracepath6 - traces path to a network host discovering MTU along this path tcpdump - dump traffic on a network tcpslice - extract pieces of and/or glue together tcpdump files mtr - a network diagnostic tool netstat - print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships netreport - request notification of network interface changes ifuser - identify destinations routed to a particular network interface nameif - name network interfaces based on MAC addresses usernetctl - allow a user to manipulate a network interface if permitted arp - manipulate the system ARP cache arping - send ARP REQUEST to a neighbour host rdisc - network router discovery daemon ipcalc - perform simple manipulation of IP addresses domainname - show or set the system´s NIS/YP domain name dnsdomainname - show the system´s DNS domain name nisdomainname - show or set system´s NIS/YP domain name ypdomainname - show or set the system´s NIS/YP domain name nodename - show or set the system´s DECnet node name mii-tool - view, manipulate media-independent interface status pppdump - convert PPP record file to readable format pppstats - print PPP statistics chat - automated conversational script with a modem wvdial - PPP dialer with built?in intelligence plipconfig - fine tune PLIP device parameters slattach - attach a network interface to a serial line setserial - get/set Linux serial port information ppp-watch - daemon to make PPP interfaces act more like other interfaces statserial - display serial port modem status lines dig - DNS lookup utility host - DNS lookup utility nslookup - query Internet name servers interactively nsupdate - Dynamic DNS update utility rndc - name server control utility nmblookup - NetBIOS over TCP/IP client used to lookup NetBIOS names nmap - network exploration tool and security scanner rx, rb, rz - XMODEM, YMODEM, ZMODEM (Batch) file receive sx, sb, sz - XMODEM, YMODEM, ZMODEM file send stunnel - universal SSL tunnel # network clients ftp - internet file transfer program ncftp - browser program for the File Transfer Protocol sftp - Secure file transfer program scp - secure copy (remote file copy program) lynx - a general purpose distributed information browser for the World Wide Web links - lynx-like alternative character mode WWW browser wget - utility for non-interactive download of files from the Web mail - send and receive mail write - send a message to another user wall - send a message to everybody´s terminal pine - a Program for Internet News and Email formail - mail (re)formatter mailstats - display mail statistics mutt - The Mutt Mail User Agent urlview - URL extractor/launcher ssh - OpenSSH SSH client (remote login program) telnet - user interface to the TELNET protocol finger - user information lookup program pinky - lightweight finger smbclient - ftp-like client to access SMB/CIFS resources on servers smbmnt - helper utility for mounting SMB filesystems smbmount - mount an smbfs filesystem smbumount - smbfs umount for normal users testprns - check printer name for validity with smbd minicom - friendly serial communication program runscript - script interpreter for minicom rdate - get the time via the network talk - talk to another user # daemons and servers crond - daemon to execute scheduled commands (Vixie Cron) syslogd - Linux system logging utilities lpd - line printer daemon xfs - X font server pppd - Point to Point Protocol daemon inetd - internet "super-server" xinetd - the extended Internet services daemon tcpd - access control facility for internet services vsftpd - Very Secure FTP Daemon httpd - Apache hypertext transfer protocol server webalizer - a web server log file analysis tool sshd - OpenSSH SSH daemon sendmail - mail delivery system smail - mail delivery system qmail - mail delivery system fetchmail - fetch mail from a POP, IMAP, ETRN, or ODMR-capable server procmail - autonomous mail processor exportfs - maintain list of NFS exported file systems nfsstat - print NFS statistics nhfsstone - Network File System benchmark program showmount - show mount information for an NFS server pmap_dump - print a list of all registered RPC programs pmap_set - set the list of registered RPC programs rpcinfo - report RPC information rdisc - network router discovery daemon smbd nmbd testparm - check an smb.conf configuration file for internal correctness # multimedia play - play any sound file to audio device showriff - show structure of RIFF files (wav, avi, ...) sox - Sound eXchange : universal sound sample translator rec - record audio to any sound file format record - records *.wav files streamer - record audio and/or video cdplay - an interactive text-mode program for controlling and playing audio CD Roms cdrecord - record audio or data Compact Discs from a master dvdrecord - record audio or data Compact Discs and DVDs from a master esd - The Enlightened Sound Daemon oggenc - encode audio into the Ogg Vorbis format oggdec - simple decoder, Ogg Vorbis file to PCM audio file (WAV or RAW) ogginfo - gives information about Ogg files, and does extensive validity checking ogg123 - plays Ogg Vorbis files vcut - cuts Ogg Vorbis files timidity - MIDI to WAV converter and player cjpeg - compress an image file to a JPEG file djpeg - decompress a JPEG file to an image file thumbnail - create a TIFF file with thumbnail images tiffcp - copy (and possibly convert) a TIFF file tiffdump - print verbatim information about TIFF files tiffinfo - print information about TIFF files tiffsplit - split a multi-image TIFF into single-image TIFF files pamcut - cut a rectangle out of a PAM, PBM, PGM, or PPM image pamdeinterlace - remove ever other row from a PAM/PNM image pamfile - describe a Netpbm (PAM or PNM) file pamoil - turn a PAM image into an oil painting pcdindex - create index image for a photo CD pnmcat - concatenate portable anymaps pnmcut - cut a rectangle out of a PBM, PGM, or PPM image pnmfile - describe a portable anymap pnmflip - perform one or more flip operations on a portable anymap ppmfade - generate a transition between two image files using special effects ppmdither - ordered dither for color images ppmrainbow - generate a rainbow ppmtv - make a portable pixmap look like taken from an American TV radio - console radio application fbset - show and modify frame buffer device settings # miscelaneous sleep - delay for a specified amount of time usleep - sleep some number of microseconds at, batch, atq, atrm - queue, examine or delete jobs for later execution atrun - run jobs queued for later execution clock - determine processor time hwclock - query and set the hardware clock (RTC) setclock - sets the hardware clock from the system clock clockdiff - measure clock difference between hosts date - print or set the system date and time ddate - converts Gregorian dates to Discordian dates cal - displays a calendar units - unit conversion program bc - an arbitrary precision calculator language dc - an arbitrary precision calculator octave - a high-level interactive language for numerical computations expr - evaluate expressions factor - print the prime factors of each number seq - print a sequence of numbers flex - fast lexical analyzer generator clear - clear the terminal screen true - do nothing, successfully false - do nothing, unsuccessfully yes - output a string repeatedly until killed tee - read from standard input and write to standard output and files lp - send requests to an LPRng print service lpc - line printer control program lpd - line printer daemon lpq - spool queue examination program lpr - off line print lprm - remove jobs from the line printer spooling queue lpstat - print information about the status of the LP print service monitor - receive logging information from LPD tunelp - set various parameters for the lp device man - format and display the on-line manual pages manpath - determine user´s search path for man pages info - read Info documents pinfo - curses based lynx-style info browser whatis - search the whatis database for complete words apropos - search the whatis database for strings card - print reference card of program options rpm - RPM Package Manager Copyright (c) 2003 Bohdan Milar