LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 08-12-2004, 11:14 PM   #1
napster
LQ Newbie
 
Registered: Aug 2004
Location: SL
Posts: 10

Rep: Reputation: 0
Exclamation how do i get the proper path to a file through find command


i have written a script to to delete all file not accessed more 30 days from a samba fileserver . it works perfectly for files that have short name . but my problem is that when ever the file name is large or has any spaces within it The find command gives the full path of the name but the RM only uses the file name cut short .
for an example

the correct file name is
\etc\myfolder\with arm wide open.mp3
this is returned by the find command
but RM requires it like
\etc\myfoder\with\arms\wide.mp3



therefore i cant delete that file throught the script
bcs there is no such file with that path

PLease help me with this problem i really need a solution fast


thanks
NAPSTER
 
Old 08-13-2004, 12:16 AM   #2
napster
LQ Newbie
 
Registered: Aug 2004
Location: SL
Posts: 10

Original Poster
Rep: Reputation: 0
test
 
Old 08-13-2004, 12:21 AM   #3
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
This should work (just an example):

$ find . -name "*test*" -exec rm {} \;

It will find and delete the following file test 1 2 3 (one file with spaces in it).

Hope this gets you going again.
 
Old 08-13-2004, 05:08 AM   #4
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Since this is clearly not a success, moved to Linux-General.
 
Old 11-07-2005, 04:35 AM   #5
napster
LQ Newbie
 
Registered: Aug 2004
Location: SL
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks

Thanks alot it worked
 
  


Reply


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
Command to find file with text chamanrana Linux - Software 10 12-02-2004 10:47 AM
Where to find the proper log file? mykrob SUSE / openSUSE 1 10-27-2004 10:12 AM
Command to find out which package contains which file ? javeree Slackware 6 07-10-2004 06:35 PM
Command to find total file size satimis Linux - Newbie 1 01-22-2004 11:19 AM
How do i find the proper linux config file? justinfl General 2 10-08-2003 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:04 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