Site Tools


server:linux_scripts

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
server:linux_scripts [2015/11/05 13:50] – ashleyserver:linux_scripts [2024/05/02 10:36] (current) – [search and remove files from directories] ashley
Line 16: Line 16:
  
  
 +=====Search for text in file===== 
 +  grep --after-context=5 --before-context=10 'Nov 12 2012' yourfile.log
  
  
Line 56: Line 57:
 ===== search and remove files from directories ===== ===== search and remove files from directories =====
   find . -type f -name "AlbumAr*" -exec rm -f {} \;   find . -type f -name "AlbumAr*" -exec rm -f {} \;
 +===== Find and replace text in files in a folder=====
 +  sudo find RTPOP* -type f -exec sed -i 's/239.216.142/239.216.146/g' {} +
 +
  
server/linux_scripts.1446731410.txt.gz · Last modified: (external edit)