snipt

Ctrl+h for KB shortcuts

Bash

Flush sendmail queue

sendmail -q -v
https://snipt.net/embed/0b8957a99bfccdb51766a640d8244393/
/raw/0b8957a99bfccdb51766a640d8244393/
0b8957a99bfccdb51766a640d8244393
bash
Bash
1
2019-07-11T04:43:49
True
False
False
Oct 29, 2012 at 11:02 AM
/api/public/snipt/24805/
flush-sendmail-queue
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>sendmail -q -v </span></pre></div> </td></tr></table>
sendmail

Bash

Extract a multi-part zip file

1
2
3
$ cat zipfiles.* > zipfiles-full.zip
$ zip -F zipfiles-full.zip
$ unzip zipfiles-full.zip
https://snipt.net/embed/5cb9bad6057ffc3dfb7599fa4671c5e9/
/raw/5cb9bad6057ffc3dfb7599fa4671c5e9/
5cb9bad6057ffc3dfb7599fa4671c5e9
bash
Bash
3
2019-07-04T22:41:01
True
False
False
/api/public/snipt/24638/
extract-a-multi-part-zip-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ cat zipfiles.* &gt; zipfiles-full.zip </span><span id="L-2"><a name="L-2"></a>$ zip -F zipfiles-full.zip </span><span id="L-3"><a name="L-3"></a>$ unzip zipfiles-full.zip </span></pre></div> </td></tr></table>
bash, zip

Bash

Show the installation folders of a package

$ rpm -qil <package_name>
https://snipt.net/embed/dab82799873756190660487f74e3957f/
/raw/dab82799873756190660487f74e3957f/
dab82799873756190660487f74e3957f
bash
Bash
1
2019-07-22T17:39:24
True
False
False
/api/public/snipt/24533/
show-the-installation-folders-of-a-package
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ rpm -qil &lt;package_name&gt; </span></pre></div> </td></tr></table>
rpm

Bash

Search files recursively for a text

$ find <search_path> -type f -exec grep -l "<search_text>" {} +
https://snipt.net/embed/5e7e9fbce1d2f4a474250172571c8743/
/raw/5e7e9fbce1d2f4a474250172571c8743/
5e7e9fbce1d2f4a474250172571c8743
bash
Bash
1
2019-07-14T04:10:41
True
False
False
/api/public/snipt/24483/
search-files-recursively-for-a-text
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ find &lt;search_path&gt; -type f -exec grep -l <span class="s2">&quot;&lt;search_text&gt;&quot;</span> <span class="o">{}</span> + </span></pre></div> </td></tr></table>
bash

Bash

Change the default shell

$ chsh
https://snipt.net/embed/3cbcce7926bac291547ab8d5ec0d91d4/
/raw/3cbcce7926bac291547ab8d5ec0d91d4/
3cbcce7926bac291547ab8d5ec0d91d4
bash
Bash
1
2019-07-22T11:50:33
True
False
False
/api/public/snipt/24382/
change-the-default-shell
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ chsh </span></pre></div> </td></tr></table>
bash

Bash

Decrypt a GPG file

$ gpg --output foo.txt --decrypt foo.txt.gpg
https://snipt.net/embed/1b9f7ddb9923ef297a00d6d1ab6f9ff9/
/raw/1b9f7ddb9923ef297a00d6d1ab6f9ff9/
1b9f7ddb9923ef297a00d6d1ab6f9ff9
bash
Bash
1
2019-07-19T12:21:34
True
False
False
/api/public/snipt/24381/
decrypt-a-gpg-file
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ gpg --output foo.txt --decrypt foo.txt.gpg </span></pre></div> </td></tr></table>
gnupg, gpg

Bash

Update alternatives

$ sudo update-alternatives --config <command>
https://snipt.net/embed/3335e572ffe961153610010b636f8e8a/
/raw/3335e572ffe961153610010b636f8e8a/
3335e572ffe961153610010b636f8e8a
bash
Bash
1
2019-07-07T23:35:29
True
False
False
/api/public/snipt/20285/
update-alternatives
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ sudo update-alternatives --config &lt;command&gt; </span></pre></div> </td></tr></table>
bash

Bash

Drop a database with mysqladmin

$ mysqladmin drop <database_name>
https://snipt.net/embed/a896471e220c8b078b875f25587dff41/
/raw/a896471e220c8b078b875f25587dff41/
a896471e220c8b078b875f25587dff41
bash
Bash
1
2019-07-19T16:29:39
True
False
False
/api/public/snipt/19237/
drop-a-database-with-mysqladmin
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ mysqladmin drop &lt;database_name&gt; </span></pre></div> </td></tr></table>
mysql, mysqladmin

Bash

Roll back committed changes

git reset --hard <hash>
git push --force origin master
https://snipt.net/embed/63313470f8aa9ba68dba31dbc98611de/
/raw/63313470f8aa9ba68dba31dbc98611de/
63313470f8aa9ba68dba31dbc98611de
bash
Bash
2
2019-07-13T20:25:58
True
False
False
Jan 16, 2013 at 07:00 AM
/api/public/snipt/18679/
roll-back-committed-changes
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git reset --hard &lt;hash&gt; </span><span id="L-2"><a name="L-2"></a>git push --force origin master </span></pre></div> </td></tr></table>
git

Bash Session

Switch between branches

git checkout <branch_name>
https://snipt.net/embed/da42e77de302d58547952c94445cbf31/
/raw/da42e77de302d58547952c94445cbf31/
da42e77de302d58547952c94445cbf31
console
Bash Session
1
2019-07-06T02:58:51
True
False
False
Sep 28, 2012 at 07:41 AM
/api/public/snipt/18494/
switch-between-branches-1
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="go">git checkout &lt;branch_name&gt;</span> </span></pre></div> </td></tr></table>
git