Difference between revisions of "Tools"

From wiki.linuxonlinehelp.eu
Jump to navigation Jump to search
Line 1: Line 1:
 
==== find ====
 
==== find ====
find multiple files/folders
+
Sample: Find multiple files/folders/by size
 
<pre>
 
<pre>
 
$find /path -type d \( -name "foldername1" -o -name "foldername2" \ )
 
$find /path -type d \( -name "foldername1" -o -name "foldername2" \ )
Line 16: Line 16:
  
 
==== grep ====
 
==== grep ====
 +
Sample: By default the Linux and Unix Config Files written with comments for help but somtimes its too much!
 +
Comments mostly starting with "#"
 +
to filter them out do:
 +
<pre>
 +
grep -v '^#' config
 +
</pre>
 +
Sytem Echos NOW only active Settings!! That's easy to control for bugs..
  
  

Revision as of 17:08, 24 May 2017

find

Sample: Find multiple files/folders/by size

$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

Sample: By default the Linux and Unix Config Files written with comments for help but somtimes its too much! Comments mostly starting with "#" to filter them out do:

grep -v '^#' config

Sytem Echos NOW only active Settings!! That's easy to control for bugs..


tar

bash scripts

Header:

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