Difference between revisions of "Tools"

From wiki.linuxonlinehelp.eu
Jump to navigation Jump to search
(Created page with "==== find ==== ==== grep ==== ==== tar ==== ==== bash scripts ==== Header: <pre> #!/bin/bash #set interpreter date=`/bin/date +%Y%m%d-%H%M%S` #...")
 
Line 1: Line 1:
 
==== find ====
 
==== find ====
 +
find multiple files/folders
 +
<pre>
 +
$find /path -type d \( -name "foldername1" -o -name "foldername2" \ )
 +
</pre>
 +
find and remove on the fly
 +
<pre>
 +
find /path -name "filename-to-delete" -type f -exec rm -rf {} \;
 +
</pre>
 +
 +
find by size over 500MB and list them into Textfile
 +
<pre>
 +
find / -size +500M -type f > /big-files.txt
 +
</pre>
  
  

Revision as of 17:07, 24 May 2017

find

find multiple files/folders

$find /path -type d \( -name "foldername1" -o -name "foldername2" \ )

find and remove on the fly

find /path -name "filename-to-delete" -type f -exec rm -rf {} \;

find by size over 500MB and list them into Textfile

find / -size +500M -type f > /big-files.txt


grep

tar

bash scripts

Header:

#!/bin/bash                        #set interpreter
date=`/bin/date +%Y%m%d-%H%M%S`    #set data-time variable for $date