snipt

Ctrl+h for KB shortcuts

Bash

Terminal check file permissions

stat -c %A fileNameToCheck
https://snipt.net/embed/69255e3c3dbfa946d35d09d6c7a914d2/
/raw/69255e3c3dbfa946d35d09d6c7a914d2/
69255e3c3dbfa946d35d09d6c7a914d2
bash
Bash
1
2019-06-13T11:34:17
True
False
False
Nov 11, 2013 at 05:32 AM
/api/public/snipt/93399/
terminal-check-file-permissions
<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>stat -c %A fileNameToCheck </span></pre></div> </td></tr></table>
bash, terminal

Bash

Show user certificates stored in Mozilla Firefox

1
2
3
certutil -K -d <PROFILE_DIRECTORY>
modutil -list -dbdir <PROFILE_DIRECTORY>
modutil -rawlist -dbdir <PROFILE_DIRECTORY>
https://snipt.net/embed/c736d144c2a86b43bf9e4695669ebd74/
/raw/c736d144c2a86b43bf9e4695669ebd74/
c736d144c2a86b43bf9e4695669ebd74
bash
Bash
3
2019-06-14T05:35:30
True
False
False
Oct 18, 2013 at 03:09 AM
/api/public/snipt/88441/
show-user-certificates-stored-in-mozilla-firefox
<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>certutil -K -d &lt;PROFILE_DIRECTORY&gt; </span><span id="L-2"><a name="L-2"></a>modutil -list -dbdir &lt;PROFILE_DIRECTORY&gt; </span><span id="L-3"><a name="L-3"></a>modutil -rawlist -dbdir &lt;PROFILE_DIRECTORY&gt; </span></pre></div> </td></tr></table>
bash, certificates, certutil, firefox, modutil, mozilla

Bash

TAR command to preserve files' permissions

1
2
3
4
5
# Compression
tar -pcvzf ABC.tar.gz ABC

# Decompression
tar -pxvzf ABC.tar.gz
https://snipt.net/embed/4d97bbd42854bf8c9bcb8d0c3b31e472/
/raw/4d97bbd42854bf8c9bcb8d0c3b31e472/
4d97bbd42854bf8c9bcb8d0c3b31e472
bash
Bash
5
2019-06-13T11:48:03
True
False
False
Oct 18, 2013 at 03:10 AM
/api/public/snipt/87757/
tar-command-to-preserve-files-permissions
<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"># Compression</span> </span><span id="L-2"><a name="L-2"></a>tar -pcvzf ABC.tar.gz ABC </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="c1"># Decompression</span> </span><span id="L-5"><a name="L-5"></a>tar -pxvzf ABC.tar.gz </span></pre></div> </td></tr></table>
bash, gz, permissions, tar

Bash

git > search history

$ git log -Stext_to_find -p
https://snipt.net/embed/0eb7bfed95040f611c21ad1f4b2dc5ae/
/raw/0eb7bfed95040f611c21ad1f4b2dc5ae/
0eb7bfed95040f611c21ad1f4b2dc5ae
bash
Bash
2
2019-06-05T20:05:12
True
False
False
Oct 07, 2013 at 09:41 PM
/api/public/snipt/86209/
git-search-history
<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>$ git log -Stext_to_find -p </span></pre></div> </td></tr></table>
bash, find, git, grep, search

Bash

How to repair a corrupted FAT32 filesystem

dosfsck -w -r -l -a -v -t <DEVICE>
https://snipt.net/embed/7f179848d48bb1646df3df15ee92b7dc/
/raw/7f179848d48bb1646df3df15ee92b7dc/
7f179848d48bb1646df3df15ee92b7dc
bash
Bash
1
2019-06-15T05:54:44
True
False
False
Oct 07, 2013 at 04:21 AM
/api/public/snipt/85972/
how-to-repair-a-corrupted-fat32-filesystem
<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>dosfsck -w -r -l -a -v -t &lt;DEVICE&gt; </span></pre></div> </td></tr></table>
bash, dosfsck, fat, filesystem, fs, repair, vfat

Text only

Oracle - Shell

1
2
3
#I came up with a situation where i need to append @ and PATH at th starting of the all files that are modified on particular day here what i did

ls -lt|grep "Sep 24" | awk '{print $9}'|sed 's/^/@\/Users\/chakri\/projects\//g'
https://snipt.net/embed/202975296bec91de33b644019acb13a3/
/raw/202975296bec91de33b644019acb13a3/
202975296bec91de33b644019acb13a3
text
Text only
3
2019-06-10T09:48:42
True
False
False
/api/public/snipt/83044/
oracle-shell
<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>#I came up with a situation where i need to append @ and PATH at th starting of the all files that are modified on particular day here what i did </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>ls -lt|grep &quot;Sep 24&quot; | awk &#39;{print $9}&#39;|sed &#39;s/^/@\/Users\/chakri\/projects\//g&#39; </span></pre></div> </td></tr></table>
bash, oracle, shell