Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
fuss:sh [2020/02/14 17:12] – [Copyright] officefuss:sh [2021/05/17 05:44] – [Find Plaintext Files] office
Line 495: Line 495:
  
 ===== For ZIP ==== ===== For ZIP ====
 +
 +Using parallel:
 +
 +<code bash>
 +find . -iname '*.zip' | parallel -j4 'cd {//}; mkdir -p "$(basename {/} .zip)"; unzip {/} -d "$(basename {/} .zip)"; rm {/}'
 +</code>
 +
 +and without parallel:
  
 <code bash> <code bash>
-find . -name '*.zip'parallel -j4 'cd {//}; mkdir -p "$(basename {/} .zip)"; unzip {/} -d "$(basename {/} .zip)"; rm {/}'+find . -iname '*.zip' -print0 xargs -0 -I{} sh -c 'd=$(basename "{}.zip); mkdir -p "$d"; unzip "{}-d "$d";'
 </code> </code>
  
Line 800: Line 808:
   * ''Y'' is the high number   * ''Y'' is the high number
  
 +====== Find Plaintext Files ======
 +
 +<code bash>
 +find . -type f -exec grep -Iq . {} \; -print
 +</code>
 +
 +====== Ensure Newline at End of File ======
 +
 +<code bash>
 +find -name \*.txt | while read f; do tail -n1 $f | read -r _ || echo >> $f; done
 +</code>
 +where:
 +  * ''*.txt'' is the pattern to search for.

fuss/sh.txt · Last modified: 2024/05/12 17:26 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.