LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 12-10-2010, 02:05 PM   #16
crts
Senior Member
 
Registered: Jan 2010
Posts: 1,604

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446

Quote:
Originally Posted by madridlinuxgroup View Post
Did you actually try my solution?
Who? Me? Yes, I tried it with some dummy files. Results as expected. Did you try your solution?
Try it with the following filenames:
Code:
a1.tex
a2.tex
a3.tex
aa
vv
xt
a.t
a.b
What the OP wants is only for the three files a1.tex,a2.tex,a3.tex to NOT be deleted. Anything else can go. Your solution will not delete xt,a.t and a.b.

P.S.: However, I noticed a typo ('.text' instead of '.tex') in my previous post. Corrected it.

Last edited by crts; 12-10-2010 at 02:07 PM.
 
Old 02-08-2014, 09:52 PM   #17
StevenXL
Member
 
Registered: Jan 2014
Posts: 69

Rep: Reputation: Disabled
Quote:
Originally Posted by GrapefruiTgirl View Post
Code:
sasha@reactor: find .  -maxdepth 1 -type f ! -iname "*.tex" -delete
This is awesome - and I didn't know you could use -delete; I always used -exec rm -f {} \;

This is much better.
 
  


Reply

Tags
shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] Use of uninitialized value in pattern match (m//) koshihaku Linux - Newbie 2 08-10-2010 01:07 PM
[SOLVED] Splitting files by pattern match bartonski Linux - Software 8 11-20-2009 10:05 AM
[SOLVED] Adding (not replacing) a pattern match with a similar pattern? b-bri Linux - Newbie 2 08-31-2009 12:36 AM
printing pattern match and not whole line that matches pattern Avatar33 Programming 13 05-06-2009 06:17 AM
Select the files of a directory that match a specific pattern jianelisj Linux - Newbie 2 03-17-2008 12:25 PM


All times are GMT -5. The time now is 05:25 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration