<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wikibase.ronzz.org/index.php?action=history&amp;feed=atom&amp;title=Cheatsheet%3ALinuxCLI%2FBash_shell</id>
	<title>Cheatsheet:LinuxCLI/Bash shell - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wikibase.ronzz.org/index.php?action=history&amp;feed=atom&amp;title=Cheatsheet%3ALinuxCLI%2FBash_shell"/>
	<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;action=history"/>
	<updated>2026-11-24T02:37:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;diff=17918&amp;oldid=prev</id>
		<title>Rongzhou at 13:09, 19 November 2026</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;diff=17918&amp;oldid=prev"/>
		<updated>2026-11-19T13:09:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;amp;diff=17918&amp;amp;oldid=17917&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Rongzhou</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;diff=17917&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: Clarify the C-y line. AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;diff=17917&amp;oldid=prev"/>
		<updated>2026-11-19T12:24:28Z</updated>

		<summary type="html">&lt;p&gt;Clarify the C-y line. AI-assisted (RonzzWikiCowriter) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 12:24, 19 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l59&quot;&gt;Line 59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# M-DEL  →  vim /etc/nginx/sites-enabled/    kills one path component&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# M-DEL  →  vim /etc/nginx/sites-enabled/    kills one path component&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# C-u kills from the cursor back to the start, C-k kills forward; &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;both are undone by &lt;/del&gt;C-y&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;# C-u kills from the cursor back to the start, C-k kills forward; C-y &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pastes either back&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
	<entry>
		<id>https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;diff=17916&amp;oldid=prev</id>
		<title>RonzzWikiCowriterAI: New cheatsheet: bash readline keys, history expansion, completion, terminal keys. AI-assisted (RonzzWikiCowriter) (via create-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wikibase.ronzz.org/index.php?title=Cheatsheet:LinuxCLI/Bash_shell&amp;diff=17916&amp;oldid=prev"/>
		<updated>2026-11-19T12:24:20Z</updated>

		<summary type="html">&lt;p&gt;New cheatsheet: bash readline keys, history expansion, completion, terminal keys. AI-assisted (RonzzWikiCowriter) (via create-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{DesktopLinux}}&lt;br /&gt;
&lt;br /&gt;
The line you are typing at the prompt is edited by GNU Readline, so these keys work in Bash and in every other Readline program (&amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;psql&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gdb&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;mysql&amp;lt;/code&amp;gt;, ...). They are pressed while the line is still on screen, before Enter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Notation: &amp;lt;code&amp;gt;C-a&amp;lt;/code&amp;gt; is Ctrl+A. &amp;lt;code&amp;gt;M-f&amp;lt;/code&amp;gt; is Alt+F, or ESC then &amp;lt;code&amp;gt;f&amp;lt;/code&amp;gt; when no Alt key is available.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Move around the line ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-a&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;C-e&amp;lt;/code&amp;gt; || beginning / end of line&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-b&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;C-f&amp;lt;/code&amp;gt; || one character back / forward&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-b&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-f&amp;lt;/code&amp;gt; || one word back / forward&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-&amp;amp;lt;&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-&amp;amp;gt;&amp;lt;/code&amp;gt; || oldest / newest entry in the history&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
# the cursor starts at the end of the line&lt;br /&gt;
git commit -m &amp;#039;fix typo in README&amp;#039;&lt;br /&gt;
# C-a      cursor to &amp;#039;git&amp;#039;&lt;br /&gt;
# M-f M-f  cursor to &amp;#039;fix&amp;#039;&lt;br /&gt;
# C-e      back to the end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Delete, and paste back ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-w&amp;lt;/code&amp;gt; || delete the word before the cursor, up to whitespace (&amp;lt;code&amp;gt;unix-word-rubout&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-DEL&amp;lt;/code&amp;gt; || delete the word before the cursor, word characters only (&amp;lt;code&amp;gt;backward-kill-word&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-d&amp;lt;/code&amp;gt; || delete the word after the cursor (&amp;lt;code&amp;gt;kill-word&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-u&amp;lt;/code&amp;gt; || delete from the line start to the cursor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-k&amp;lt;/code&amp;gt; || delete from the cursor to the end of the line&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-y&amp;lt;/code&amp;gt; || paste back the last deleted text (yank)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-y&amp;lt;/code&amp;gt; || replace the pasted text with older deleted text, only right after &amp;lt;code&amp;gt;C-y&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-_&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;C-x C-u&amp;lt;/code&amp;gt; || undo&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Deleted text is not lost: it goes to the kill ring and can be pasted back later, even on the next line.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
# cursor at the end of the line&lt;br /&gt;
vim /etc/nginx/sites-enabled/default&lt;br /&gt;
# C-w    →  vim                              kills back to the previous space&lt;br /&gt;
# M-DEL  →  vim /etc/nginx/sites-enabled/    kills one path component&lt;br /&gt;
&lt;br /&gt;
# C-u kills from the cursor back to the start, C-k kills forward; both are undone by C-y&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Transpose and change case ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-t&amp;lt;/code&amp;gt; || swap the 2 characters around the cursor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-t&amp;lt;/code&amp;gt; || swap the 2 words around the cursor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-u&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-l&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-c&amp;lt;/code&amp;gt; || upcase / downcase / capitalize the word&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
The case commands act on the word at the cursor and move forward, so pressing &amp;lt;code&amp;gt;M-u&amp;lt;/code&amp;gt; at the end of the line changes nothing. Move back with &amp;lt;code&amp;gt;M-b&amp;lt;/code&amp;gt; first.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
echo hELLO world&lt;br /&gt;
# M-b M-b M-c  →  echo Hello world    capitalize (rest of the word is lowercased)&lt;br /&gt;
# M-b M-b M-l  →  echo hello world    downcase&lt;br /&gt;
# M-b M-b M-u  →  echo HELLO world    upcase&lt;br /&gt;
&lt;br /&gt;
echo one two&lt;br /&gt;
# M-t  →  echo two one&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-p&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;C-n&amp;lt;/code&amp;gt; || previous / next command&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-r&amp;lt;/code&amp;gt; || reverse incremental search: type a substring, &amp;lt;code&amp;gt;C-r&amp;lt;/code&amp;gt; again for the next older match&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-s&amp;lt;/code&amp;gt; || the same, searching forward&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-p&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-n&amp;lt;/code&amp;gt; || non-incremental search backward / forward for a string you type after the prompt&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-.&amp;lt;/code&amp;gt; || insert the last argument of the previous command; press again for the command before it&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-C-y&amp;lt;/code&amp;gt; || insert the first argument of the previous command; with a number, the nth (0 is the command itself)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-o&amp;lt;/code&amp;gt; || run this line, then fetch the next history entry for editing&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-x C-e&amp;lt;/code&amp;gt; || edit the line in &amp;lt;code&amp;gt;$VISUAL&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;$EDITOR&amp;lt;/code&amp;gt;, then run the result&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;C-r&amp;lt;/code&amp;gt; leaves the matching command on the line: &amp;lt;code&amp;gt;C-g&amp;lt;/code&amp;gt; aborts the search and gives back the line you were typing, any movement key (&amp;lt;code&amp;gt;C-a&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;M-b&amp;lt;/code&amp;gt;, ...) stops the search and lets you edit the match, Enter runs it.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;C-s&amp;lt;/code&amp;gt; is often swallowed by terminal flow control (see [[#Screen and processes]]); &amp;lt;code&amp;gt;stty -ixon&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; frees it.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
# C-r  ssh        the most recent command containing &amp;#039;ssh&amp;#039;; C-r again for older ones&lt;br /&gt;
# C-x C-e         a long loop: vim opens, edit it comfortably, save and quit, bash runs it&lt;br /&gt;
# C-o             step through a block of commands you ran earlier, editing each before running&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== History expansion ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
!!                    # rerun the previous command&lt;br /&gt;
!$                    # last argument of the previous command&lt;br /&gt;
!^                    # first argument&lt;br /&gt;
!*                    # all arguments&lt;br /&gt;
!:2                   # 2nd argument&lt;br /&gt;
!-2                   # the command before the previous one&lt;br /&gt;
!ssh                  # most recent command starting with ssh&lt;br /&gt;
!?docker?             # most recent command containing docker&lt;br /&gt;
^old^new^             # rerun the previous command, first old replaced by new&lt;br /&gt;
!!:gs/old/new/        # rerun it, every old replaced by new&lt;br /&gt;
!$:h                  # last argument, minus its last path component:  /a/b/c.pdf → /a/b&lt;br /&gt;
!$:t                  # last argument, basename only:                     /a/b/c.pdf → c.pdf&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
sudo !!                                          # the command you forgot to prefix with sudo&lt;br /&gt;
mkdir -p /srv/app/releases/2026-11-19&lt;br /&gt;
cd !$                                            # → cd /srv/app/releases/2026-11-19&lt;br /&gt;
git status&lt;br /&gt;
^status^diff^                                    # → git diff&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Expansion happens on the whole line, before it runs, and inside double quotes too: &amp;lt;code&amp;gt;echo &amp;quot;!$&amp;quot;&amp;lt;/code&amp;gt; expands, &amp;lt;code&amp;gt;echo &amp;#039;!$&amp;#039;&amp;lt;/code&amp;gt; does not. &amp;lt;code&amp;gt;set +H&amp;lt;/code&amp;gt; turns expansion off; &amp;lt;code&amp;gt;shopt -s histverify&amp;lt;/code&amp;gt; shows the expanded line for confirmation before running it.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Completion and typing helpers ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;Tab&amp;lt;/code&amp;gt; || complete the word; press twice to list the candidates&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-?&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;M-=&amp;lt;/code&amp;gt; || list the possible completions&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-*&amp;lt;/code&amp;gt; || insert all the possible completions&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-/&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-$&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;M-~&amp;lt;/code&amp;gt; || complete a filename / a variable / a username after &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-C-e&amp;lt;/code&amp;gt; || expand the line as the shell would (aliases, variables, &amp;lt;code&amp;gt;~&amp;lt;/code&amp;gt;), then leave it for review&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-#&amp;lt;/code&amp;gt; || comment the line out with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; and keep it in the history&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-v&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;C-q&amp;lt;/code&amp;gt; || insert the next key literally (a Tab, a &amp;lt;code&amp;gt;C-m&amp;lt;/code&amp;gt;, ...)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
cd ~/Doc&amp;lt;Tab&amp;gt;              # → cd ~/Documents&lt;br /&gt;
ls /usr/shar&amp;lt;Tab&amp;gt;          # the single match is inserted, no list needed&lt;br /&gt;
# M-C-e on   ll ~/x/*&lt;br /&gt;
#   becomes  ls -l /home/user/x/*&lt;br /&gt;
# M-# on   rm -rf build/   →  #rm -rf build/   stored and recalled later, not run&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Screen and processes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Key !! Action&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-l&amp;lt;/code&amp;gt; || clear the screen, keep the line being typed&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;M-C-l&amp;lt;/code&amp;gt; || clear the screen and the scrollback buffer&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-c&amp;lt;/code&amp;gt; || interrupt the running command&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-d&amp;lt;/code&amp;gt; || end of input: logs out an interactive shell, or deletes the character under the cursor&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-z&amp;lt;/code&amp;gt; || suspend the running command; &amp;lt;code&amp;gt;fg&amp;lt;/code&amp;gt; brings it back, &amp;lt;code&amp;gt;bg&amp;lt;/code&amp;gt; continues it in the background&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;C-s&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;C-q&amp;lt;/code&amp;gt; || freeze / resume terminal output: an accidental &amp;lt;code&amp;gt;C-s&amp;lt;/code&amp;gt; looks like a hang, press &amp;lt;code&amp;gt;C-q&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
sleep 100     # C-z: suspended, back at the prompt&lt;br /&gt;
bg            # continue it in the background&lt;br /&gt;
fg            # or bring it to the foreground&lt;br /&gt;
jobs          # what is running or suspended in this shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Change the bindings ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot; copy&amp;gt;&lt;br /&gt;
set -o vi                                # vi keys (ESC, k, j, dd, ...) instead of emacs keys&lt;br /&gt;
set -o emacs                             # back to the default&lt;br /&gt;
bind -p                                  # every key and the function bound to it&lt;br /&gt;
bind -p | grep -i yank                   # what is bound to yanking&lt;br /&gt;
bind -l                                  # names of all bindable functions&lt;br /&gt;
bind &amp;#039;&amp;quot;\C-o&amp;quot;: &amp;quot;| less\n&amp;quot;&amp;#039;                # macro: C-o types &amp;#039; | less&amp;#039; and presses Enter&lt;br /&gt;
bind -x &amp;#039;&amp;quot;\C-x\C-l&amp;quot;: ls -l&amp;#039;              # shell command whose output is shown, the line stays&lt;br /&gt;
bind &amp;#039;&amp;quot;\C-h&amp;quot;: backward-delete-char&amp;#039;      # rebind one key&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Settings for every Readline program (Bash, &amp;lt;code&amp;gt;python&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;psql&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;gdb&amp;lt;/code&amp;gt;, ...) live in &amp;lt;code&amp;gt;~/.inputrc&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot; copy&amp;gt;&lt;br /&gt;
set editing-mode vi&lt;br /&gt;
set show-all-if-ambiguous on       # Tab lists the candidates at once instead of beeping&lt;br /&gt;
set completion-ignore-case on&lt;br /&gt;
&amp;quot;\e[1;5C&amp;quot;: forward-word            # Ctrl+Right: one word forward&lt;br /&gt;
&amp;quot;\C-x\C-r&amp;quot;: re-read-init-file      # C-x C-r: apply the edits without restarting the shell&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Bindings in &amp;lt;code&amp;gt;~/.bashrc&amp;lt;/code&amp;gt; apply to Bash only; &amp;lt;code&amp;gt;~/.inputrc&amp;lt;/code&amp;gt; applies to every program that uses Readline. &amp;lt;code&amp;gt;bind -p&amp;lt;/code&amp;gt; prints the bindings in &amp;lt;code&amp;gt;~/.inputrc&amp;lt;/code&amp;gt; syntax, so its output can be pasted there.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== For more ==&lt;br /&gt;
&lt;br /&gt;
* [https://www.gnu.org/software/bash/manual/html_node/Readline-Interaction.html Readline interaction] — the short official tour: moving, killing, searching&lt;br /&gt;
* [https://www.gnu.org/software/bash/manual/html_node/History-Interaction.html History interaction] — every &amp;lt;code&amp;gt;!&amp;lt;/code&amp;gt; form, word designator and modifier&lt;br /&gt;
* [https://tiswww.case.edu/php/chet/readline/readline.html GNU Readline manual] — every bindable command and variable&lt;br /&gt;
* [https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File.html Readline init file] — &amp;lt;code&amp;gt;~/.inputrc&amp;lt;/code&amp;gt; syntax&lt;br /&gt;
* &amp;lt;code&amp;gt;man readline&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;man bash&amp;lt;/code&amp;gt; (search &amp;lt;code&amp;gt;/^READLINE&amp;lt;/code&amp;gt;), &amp;lt;code&amp;gt;bind -p&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>RonzzWikiCowriterAI</name></author>
	</entry>
</feed>