Advertisement
R0lf_R1s1k0

Bash Built-In Cheatsheet

Nov 11th, 2016
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.10 KB | None | 0 0
  1. An A-Z Index of Bash build-in commands for Linux.
  2.  
  3. alias Create an alias •
  4. apropos Search Help manual pages (man -k)
  5. apt-get Search for and install software packages (Debian/Ubuntu)
  6. aptitude Search for and install software packages (Debian/Ubuntu)
  7. aspell Spell Checker
  8. awk Find and Replace text, database sort/validate/index
  9. b
  10. basename Strip directory and suffix from filenames
  11. bash GNU Bourne-Again SHell
  12. bc Arbitrary precision calculator language
  13. bg Send to background
  14. bind Set or display readline key and function bindings •
  15. break Exit from a loop •
  16. builtin Run a shell builtin
  17. bzip2 Compress or decompress named file(s)
  18. c
  19. cal Display a calendar
  20. case Conditionally perform a command
  21. cat Concatenate and print (display) the content of files
  22. cd Change Directory
  23. cfdisk Partition table manipulator for Linux
  24. chgrp Change group ownership
  25. chmod Change access permissions
  26. chown Change file owner and group
  27. chroot Run a command with a different root directory
  28. chkconfig System services (runlevel)
  29. cksum Print CRC checksum and byte counts
  30. clear Clear terminal screen
  31. cmp Compare two files
  32. comm Compare two sorted files line by line
  33. command Run a command - ignoring shell functions •
  34. continue Resume the next iteration of a loop •
  35. cp Copy one or more files to another location
  36. cron Daemon to execute scheduled commands
  37. crontab Schedule a command to run at a later time
  38. csplit Split a file into context-determined pieces
  39. curl Transfer data from or to a server
  40. cut Divide a file into several parts
  41. d
  42. date Display or change the date & time
  43. dc Desk Calculator
  44. dd Convert and copy a file, write disk headers, boot records
  45. ddrescue Data recovery tool
  46. declare Declare variables and give them attributes •
  47. df Display free disk space
  48. diff Display the differences between two files
  49. diff3 Show differences among three files
  50. dig DNS lookup
  51. dir Briefly list directory contents
  52. dircolors Colour setup for `ls'
  53. dirname Convert a full pathname to just a path
  54. dirs Display list of remembered directories
  55. dmesg Print kernel & driver messages
  56. du Estimate file space usage
  57. e
  58. echo Display message on screen •
  59. egrep Search file(s) for lines that match an extended expression
  60. eject Eject removable media
  61. enable Enable and disable builtin shell commands •
  62. env Environment variables
  63. ethtool Ethernet card settings
  64. eval Evaluate several commands/arguments
  65. exec Execute a command
  66. exit Exit the shell
  67. expect Automate arbitrary applications accessed over a terminal
  68. expand Convert tabs to spaces
  69. export Set an environment variable
  70. expr Evaluate expressions
  71. f
  72. false Do nothing, unsuccessfully
  73. fdformat Low-level format a floppy disk
  74. fdisk Partition table manipulator for Linux
  75. fg Send job to foreground
  76. fgrep Search file(s) for lines that match a fixed string
  77. file Determine file type
  78. find Search for files that meet a desired criteria
  79. fmt Reformat paragraph text
  80. fold Wrap text to fit a specified width.
  81. for Expand words, and execute commands
  82. format Format disks or tapes
  83. free Display memory usage
  84. fsck File system consistency check and repair
  85. ftp File Transfer Protocol
  86. function Define Function Macros
  87. fuser Identify/kill the process that is accessing a file
  88. g
  89. gawk Find and Replace text within file(s)
  90. getopts Parse positional parameters
  91. grep Search file(s) for lines that match a given pattern
  92. groupadd Add a user security group
  93. groupdel Delete a group
  94. groupmod Modify a group
  95. groups Print group names a user is in
  96. gzip Compress or decompress named file(s)
  97. h
  98. hash Remember the full pathname of a name argument
  99. head Output the first part of file(s)
  100. help Display help for a built-in command •
  101. history Command History
  102. hostname Print or set system name
  103. htop Interactive process viewer
  104. i
  105. iconv Convert the character set of a file
  106. id Print user and group id's
  107. if Conditionally perform a command
  108. ifconfig Configure a network interface
  109. ifdown Stop a network interface
  110. ifup Start a network interface up
  111. import Capture an X server screen and save the image to file
  112. install Copy files and set attributes
  113. ip Routing, devices and tunnels
  114. j
  115. jobs List active jobs •
  116. join Join lines on a common field
  117. k
  118. kill Kill a process by specifying its PID
  119. killall Kill processes by name
  120. l
  121. less Display output one screen at a time
  122. let Perform arithmetic on shell variables •
  123. link Create a link to a file
  124. ln Create a symbolic link to a file
  125. local Create variables •
  126. locate Find files
  127. logname Print current login name
  128. logout Exit a login shell •
  129. look Display lines beginning with a given string
  130. lpc Line printer control program
  131. lpr Off line print
  132. lprint Print a file
  133. lprintd Abort a print job
  134. lprintq List the print queue
  135. lprm Remove jobs from the print queue
  136. lsblk List block devices
  137. ls List information about file(s)
  138. lsof List open files
  139. m
  140. make Recompile a group of programs
  141. man Help manual
  142. mkdir Create new folder(s)
  143. mkfifo Make FIFOs (named pipes)
  144. mkisofs Create an hybrid ISO9660/JOLIET/HFS filesystem
  145. mknod Make block or character special files
  146. more Display output one screen at a time
  147. most Browse or page through a text file
  148. mount Mount a file system
  149. mtools Manipulate MS-DOS files
  150. mtr Network diagnostics (traceroute/ping)
  151. mv Move or rename files or directories
  152. mmv Mass Move and rename (files)
  153. n
  154. nc Netcat, read and write data across networks
  155. netstat Networking information
  156. nice Set the priority of a command or job
  157. nl Number lines and write files
  158. nohup Run a command immune to hangups
  159. notify-send Send desktop notifications
  160. nslookup Query Internet name servers interactively
  161. o
  162. open Open a file in its default application
  163. op Operator access
  164. p
  165. passwd Modify a user password
  166. paste Merge lines of files
  167. pathchk Check file name portability
  168. ping Test a network connection
  169. pgrep List processes by name
  170. pkill Kill processes by name
  171. popd Restore the previous value of the current directory
  172. pr Prepare files for printing
  173. printcap Printer capability database
  174. printenv Print environment variables
  175. printf Format and print data •
  176. ps Process status
  177. pushd Save and then change the current directory
  178. pv Monitor the progress of data through a pipe
  179. pwd Print Working Directory
  180. q
  181. quota Display disk usage and limits
  182. quotacheck Scan a file system for disk usage
  183. r
  184. ram ram disk device
  185. rar Archive files with compression
  186. rcp Copy files between two machines
  187. read Read a line from standard input •
  188. readarray Read from stdin into an array variable •
  189. readonly Mark variables/functions as readonly
  190. reboot Reboot the system
  191. rename Rename files
  192. renice Alter priority of running processes
  193. remsync Synchronize remote files via email
  194. return Exit a shell function
  195. rev Reverse lines of a file
  196. rm Remove files
  197. rmdir Remove folder(s)
  198. rsync Remote file copy (Synchronize file trees)
  199. s
  200. screen Multiplex terminal, run remote shells via ssh
  201. scp Secure copy (remote file copy)
  202. sdiff Merge two files interactively
  203. sed Stream Editor
  204. select Accept keyboard input
  205. seq Print numeric sequences
  206. set Manipulate shell variables and functions
  207. sftp Secure File Transfer Program
  208. shift Shift positional parameters
  209. shopt Shell Options
  210. shutdown Shutdown or restart linux
  211. sleep Delay for a specified time
  212. slocate Find files
  213. sort Sort text files
  214. source Run commands from a file '.'
  215. split Split a file into fixed-size pieces
  216. ss Socket Statistics
  217. ssh Secure Shell client (remote login program)
  218. stat Display file or file system status
  219. strace Trace system calls and signals
  220. su Substitute user identity
  221. sudo Execute a command as another user
  222. sum Print a checksum for a file
  223. suspend Suspend execution of this shell •
  224. sync Synchronize data on disk with memory
  225. t
  226. tail Output the last part of file
  227. tar Store, list or extract files in an archive
  228. tee Redirect output to multiple files
  229. test Evaluate a conditional expression
  230. time Measure Program running time
  231. timeout Run a command with a time limit
  232. times User and system times
  233. touch Change file timestamps
  234. top List processes running on the system
  235. tput Set terminal-dependent capabilities, color, position
  236. traceroute Trace Route to Host
  237. trap Run a command when a signal is set(bourne)
  238. tr Translate, squeeze, and/or delete characters
  239. true Do nothing, successfully
  240. tsort Topological sort
  241. tty Print filename of terminal on stdin
  242. type Describe a command •
  243. u
  244. ulimit Limit user resources •
  245. umask Users file creation mask
  246. umount Unmount a device
  247. unalias Remove an alias •
  248. uname Print system information
  249. unexpand Convert spaces to tabs
  250. uniq Uniquify files
  251. units Convert units from one scale to another
  252. unrar Extract files from a rar archive
  253. unset Remove variable or function names
  254. unshar Unpack shell archive scripts
  255. until Execute commands (until error)
  256. uptime Show uptime
  257. useradd Create new user account
  258. userdel Delete a user account
  259. usermod Modify user account
  260. users List users currently logged in
  261. uuencode Encode a binary file
  262. uudecode Decode a file created by uuencode
  263. v
  264. v Verbosely list directory contents (`ls -l -b')
  265. vdir Verbosely list directory contents (`ls -l -b')
  266. vi Text Editor
  267. vmstat Report virtual memory statistics
  268. w
  269. wait Wait for a process to complete •
  270. watch Execute/display a program periodically
  271. wc Print byte, word, and line counts
  272. whereis Search the user's $path, man pages and source files for a program
  273. which Search the user's $path for a program file
  274. while Execute commands
  275. who Print all usernames currently logged in
  276. whoami Print the current user id and name (`id -un')
  277. wget Retrieve web pages or files via HTTP, HTTPS or FTP
  278. write Send a message to another user
  279. x
  280. xargs Execute utility, passing constructed argument list(s)
  281. xdg-open Open a file or URL in the user's preferred application.
  282. xz Compress or decompress .xz and .lzma files
  283. yes Print a string until interrupted
  284. zip Package and compress (archive) files.
  285. . Run a command script in the current shell
  286. !! Run the last command again
  287. ### Comment / Remark
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement