LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-30-2014, 08:04 AM   #1
archh
LQ Newbie
 
Registered: Sep 2014
Posts: 3

Rep: Reputation: Disabled
Question Secure remove (srm) every log file excluding a certain directory, xargs problem...


In the /var/log/ directory, i'm trying to do this command:

find ./ | grep -vi "installer" | xargs rm

with secure remove, srm:

find ./ | grep -vi "installer" | xargs 'srm -d -f -ll -r -v -z -'

I want to secure delete every file EXCEPT the ./installer
directory and the files inside it.

Can xargs do this ?
 
Old 09-30-2014, 09:05 AM   #2
archh
LQ Newbie
 
Registered: Sep 2014
Posts: 3

Original Poster
Rep: Reputation: Disabled
Ok, google finally helped me:

shopt -s extglob
srm -d -f -ll -r -v -z !(*installer*)
shopt -u extglob

or just erasing the *.1, *.gz files:
srm -d -f -ll -r -v -z *.1
srm -d -f -ll -r -v -z *.gz

Anyway
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
remove files excluding those with specified extensions Melsync Linux - General 17 08-14-2015 05:16 AM
remove files older than x days, excluding one of the directory? slowerogue Linux - Newbie 2 05-08-2013 04:28 AM
secure log file entries not appearing in loganalyzer kaplan71 Linux - Software 4 10-05-2010 01:52 PM
[SOLVED] Missing Secure.log file judoka Linux - Security 1 07-11-2010 04:10 PM
Logging to secure directory instead of /var/log... b10m3ch4 Linux - Server 2 12-16-2009 11:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 11:10 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration