snipt

Ctrl+h for KB shortcuts

Bash

Kill a Process by Name

$ pkill <process_name>
https://snipt.net/embed/77f3076d49053195ef1a19620c0ff111/
/raw/77f3076d49053195ef1a19620c0ff111/
77f3076d49053195ef1a19620c0ff111
bash
Bash
1
2019-06-16T00:36:17
True
False
False
Jul 22, 2012 at 12:50 PM
/api/public/snipt/44291/
kill-a-process-by-name
<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>$ pkill &lt;process_name&gt; </span></pre></div> </td></tr></table>
bash, linux

Bash

List out files of a package

$ dpkg -L <package_name>
https://snipt.net/embed/79d483aca302990a6bd2a84148a82f22/
/raw/79d483aca302990a6bd2a84148a82f22/
79d483aca302990a6bd2a84148a82f22
bash
Bash
1
2019-07-11T16:59:44
True
False
False
/api/public/snipt/32439/
list-out-files-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>$ dpkg -L &lt;package_name&gt; </span></pre></div> </td></tr></table>
dpkg, linux, ubuntu

Bash

Install from an RPM file

$ rpm -iv <rpm_file>
https://snipt.net/embed/a71a014acd1e993157c58213d0af02ba/
/raw/a71a014acd1e993157c58213d0af02ba/
a71a014acd1e993157c58213d0af02ba
bash
Bash
1
2019-07-07T15:28:57
True
False
False
/api/public/snipt/26663/
install-from-an-rpm-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>$ rpm -iv &lt;rpm_file&gt; </span></pre></div> </td></tr></table>
bash, linux, rpm

Bash

Show the current Linux distro

$ cat /etc/issue
https://snipt.net/embed/a169ef1c8f6334003f7fcb5bbb15777a/
/raw/a169ef1c8f6334003f7fcb5bbb15777a/
a169ef1c8f6334003f7fcb5bbb15777a
bash
Bash
1
2019-07-02T21:41:34
True
False
False
/api/public/snipt/26662/
show-the-current-linux-distro
<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>$ cat /etc/issue </span></pre></div> </td></tr></table>
bash, linux

Bash

Change password

1
2
3
4
5
# Change your own password
$ passwd

# Change a user's password
$ passwd <username>
https://snipt.net/embed/230c5ef9948768b0adda362eda497200/
/raw/230c5ef9948768b0adda362eda497200/
230c5ef9948768b0adda362eda497200
bash
Bash
5
2019-06-20T12:45:24
True
False
False
/api/public/snipt/26661/
change-password-1
<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> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Change your own password</span> </span><span id="L-2"><a name="L-2"></a>$ passwd </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Change a user&#39;s password</span> </span><span id="L-5"><a name="L-5"></a>$ passwd &lt;username&gt; </span></pre></div> </td></tr></table>
bash, linux

Bash

Create a new user

$ useradd -mU -p <password> <username>
https://snipt.net/embed/8bd9b2535e2780ae7d0d3a83de6e7b60/
/raw/8bd9b2535e2780ae7d0d3a83de6e7b60/
8bd9b2535e2780ae7d0d3a83de6e7b60
bash
Bash
1
2019-06-10T12:24:52
True
False
False
/api/public/snipt/26172/
create-a-new-user
<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>$ useradd -mU -p &lt;password&gt; &lt;username&gt; </span></pre></div> </td></tr></table>
bash, linux, user