Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-30-2004, 08:59 AM   #1
LQ Newbie
Registered: Aug 2003
Distribution: Redhat 9.0
Posts: 14

Rep: Reputation: 0
'find' expression question

find . -name *.*~ -print0 | xargs -0 rm

for deleting all files that contain a ~ I should use this command.
But where in that command is the destination explained?

Or does find only works in the tree you start it? like rm...

Old 04-30-2004, 09:45 AM   #2
Registered: Dec 2003
Location: Johannesburg, South Africa
Distribution: Mandrake
Posts: 48

Rep: Reputation: 15
it searches from where you start it.

btw aren't you supposed to do xargs -n 1 rm?
Old 05-01-2004, 12:03 AM   #3
Registered: May 2003
Posts: 46

Rep: Reputation: 15
When you put . after find you are telling it to look in the current directory and every directory under it. To find all files use / instead of . I've had problems piping commands directly to find, so good luck.
Old 05-03-2004, 07:41 AM   #4
LQ Newbie
Registered: Aug 2003
Distribution: Redhat 9.0
Posts: 14

Original Poster
Rep: Reputation: 0
All worked perfectly. thx guys

'xargs -n 1 rm' What does that mean?



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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular expression question gauge73 Linux - General 5 10-28-2005 11:33 AM
Reg Expression Question windisch Programming 6 10-04-2005 11:08 AM
Regular expression question. groentebroer Programming 2 11-29-2004 09:15 PM
Regular expression question - John Sloan Linux - Software 1 09-08-2004 12:33 PM
Simple expression question shaggz Linux - General 2 11-20-2003 11:30 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:00 PM.

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