Home Man
Search
Today's Posts
Register

RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Finding files older than x days within directory with spaces

Tags
linux

Login to Reply

 
Thread Tools Search this Thread
# 1  
Old 04-20-2018
Finding files older than x days within directory with spaces

Hi,

I am trying to run a command that finds all files over x amount of days, issue is one of the directories has spaces within it.

Code:
find /files/target directory/*/* -type f -mtime +60

When running the above the usual error message is thrown back

Code:
+ find '/files/target\' 'directory/*/*' -type f -mtime +60
find: ‚/files/target\\‚: No such file or directory
find: ‚directory/*/*‚: No such file or directory

I have tried backspacing out the space

Code:
/target\ directory/

and also putting into quotes

Code:
/"target directory"/

But still find issues.

Any help is much appreciated.
# 2  
Old 04-20-2018
The directory to search by find does not really need the /*/* at the end. It will start where you put it and search down from that point.

Try it like this, escaping the space properly and without any quoting:-
Code:
find /files/target\ directory -type f -mtime +60

An alternate might be with quoting:-
Code:
find '/files/target directory' -type f -mtime +60



I hope that this helps,
Robin
Login to Reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
List and Delete Files which are older than 7 days, but have white spaces in file name karumudi7 Shell Programming and Scripting 16 04-26-2015 11:09 PM
How to move the files older than x days with similar directory structure? prvnrk Shell Programming and Scripting 3 09-18-2014 01:22 PM
Want to delete directory, subdirectories and all files which are older than 7 days vinodkmpal AIX 1 10-16-2012 04:41 PM
Delete files older than 10 Days in a directory rajeshjohney Shell Programming and Scripting 9 05-25-2012 09:31 AM
Finding directories older than 5 days mytempid07 Shell Programming and Scripting 4 04-27-2010 06:50 AM
Script for parsing directories one level and finding directories older than n days ejianu Shell Programming and Scripting 5 08-26-2009 11:24 AM
Deleting / finding files older than X days missess a day guruparan18 Shell Programming and Scripting 4 05-08-2008 06:09 AM
Finding cumulative size of files older than certain days rohan076 Shell Programming and Scripting 1 04-28-2008 01:07 PM
List directory 7 days older krishnarao Shell Programming and Scripting 3 06-28-2007 01:06 PM
tar files older than 30 days wfch UNIX for Dummies Questions & Answers 6 04-19-2004 04:40 AM


All times are GMT -4. The time now is 01:36 PM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.
UNIX.COM Login
Username:
Password:  
Show Password