Output of entire file cat Concatenate -n tac Concatenate in reverse. rev each line in reverse nl Number lines -nln -w1 -s' ' od every character -c OR -a -Ad -w10 enscript convert to PostScript, send to printer Formatting file contents fmt Reformat paragraphs -w90 -t(1st line) -s(no refill) pr Paginate or columnate for printing. fold Wrap input lines to fit in specified width. Output of parts of file head Output the first part of files. -20 tail Output the last part of files. -20 +20 -f split Split a file into fixed-size pieces. -b10k -b5m csplit Split a file into context-determined pieces. grep search lines w/reg expr match -e -n -l -c -i sed stream editor Summarizing file wc Print newline, word, and byte counts. -L file what type of file sum Print checksum and block counts. cksum Print CRC checksum and byte counts. md5sum Print or check message-digests. Operating on sorted file sort Sort text files. -n -r -u -k3 +2 -t: uniq Uniquify files. comm Compare two sorted files line by line. ptx Produce a permuted index of file contents. tsort Topological sort. Comparing files cmp f1 f2 identical or first line mismatch diff f1 f2 differences, how to convert one to the other Operating on fields within a line cut fields or columns. -c3-12,15 -f2,4-6 -d' ' paste side by side. -d' ' join Join 2 sorted files on a common field. Operating on characters tr Translate, squeeze, and/or delete characters. -d -c -s expand Convert tabs to spaces. unexpand Convert spaces to tabs. -a Directory listing ls List directory contents -l -t -a -S -F dir Briefly list directory contents same as ls? vdir Verbosely list directory contents == ls -l dircolors Color setup for `ls' tar -czf mytarball.gz compressed tarball file of folder zip -r arf.zip * unzip [-l] Basic operations cp Copy files and directories -i dd Convert and copy a file raw copy of image install Copy files and set attributes mv Move (rename) files -i rm Remove files or directories -r recurse into subfolders shred Remove files more securely. or device file locate find names in slocate database strings in an exe file find search the filesystem wget http://whatever.com/file Special file types link Make a hard link via the link syscall ln Make links between files -s mkdir Make directories mkfifo Make FIFOs (named pipes) mknod Make block or character special files readlink Print the referent of a symbolic link rmdir Remove empty directories unlink Remove files via unlink syscall lsusb lspci lsdev fdisk mount fsck ldd lsmod Changing file attributes chown Change file owner and group. often root only chgrp Change group ownership chmod Change access permissions file:644 rw-r--r-- 600 rw------- dir :755 rwxr-xr-x 700 rwx------ umask default permissions mask from 666/777 077 == 600/700 022 == 644/755 touch Change file timestamps. to force source recompile Disk usage df Report file system disk space usage -h -i du Estimate file space usage -h -c -s stat Report file status sync Synchronize data on disk with memory. flush buffers, esp. removable writable media Printing text echo Print a line of text. test shell interpretation of cmd line printf Format and print data yes Print a string until interrupted Conditions in scripts false Do nothing, unsuccessfully true Do nothing, successfully test Check file types and compare values expr Evaluate expressions Redirection in pipeline tee Redirect output to files and to standard output File name manipulation in scripts basename Strip directory and suffix from a file name dirname Strip non-directory suffix from a file name pathchk Check file name portability Working context pwd Print working directory stty Print or change terminal characteristics tty Print file name of terminal on standard input reset clear 'Martian' terminal clear clear screen printenv Print environment variables alias list aliases typeset -f list functions which cmd in PATH type cmd what is the cmd (builtin,alias,function,program) man cmd man page apropos string cmds matching synopsis help [builtin] bash builtins help User information id uid, gid, groups logname current login name whoami effective user ID groups group names a user is in users login names of users currently logged in who who is currently logged in w System context date software clock +%s (epoch) -s TIME rdate set the systemâ..s date from a remote host hwclock hardware (RTC CMOS) clock --systohc uname Print system information -a hostname Print or set system name hostid Print numeric host identifier. lsb_release -a distro free RAM Modified command invocation chroot Run a command with a different root directory env Run a command in a modified environment nice Run a command with modified niceness nohup Run a command immune to hangups su switch user -(as if login) Process control ps list processes x ux aux aex pstree -Gphc username top kill Send a signal to a process. PID -l default:SIGTERM:15 SIGKILL:-9 SIGHUP:1(reread config) Delaying sleep Delay for a specified time SECs Numeric operations factor prime factors seq int/float sequences [first][inc]last -w -s' ' Network ping netstat nmap telnet ssh scp ifconfig iwconfig dhcp arp route traceroute/tracepath