snipt

Ctrl+h for KB shortcuts

Bash

Find all files by extension in a directory recursively

find directory/ -name \*.txt -print
https://snipt.net/embed/80b8c205e59dafa2b74aaef8ad089f91/
/raw/80b8c205e59dafa2b74aaef8ad089f91/
80b8c205e59dafa2b74aaef8ad089f91
bash
Bash
1
2019-06-23T14:47:35
True
False
False
Aug 10, 2012 at 06:59 AM
/api/public/snipt/45493/
find-all-files-by-extension-in-a-directory-recursively
<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 directory/ -name <span class="se">\*</span>.txt -print </span></pre></div> </td></tr></table>
all, bash, directory, extension, files, find, linux, recursive, recursively, sh

Bash

Unzip all files at once

ls *.zip | xargs -n1 unzip
https://snipt.net/embed/11a8501e1b6eea0747b861cc9651ca5e/
/raw/11a8501e1b6eea0747b861cc9651ca5e/
11a8501e1b6eea0747b861cc9651ca5e
bash
Bash
1
2019-06-23T22:33:22
True
False
False
/api/public/snipt/2498/
unzip-all-files-at-once
<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>ls *.zip <span class="p">|</span> xargs -n1 unzip </span></pre></div> </td></tr></table>
all, bash, unix, unzip