Results 1 to 10 of 12
I want to list all file that is not modify in last two month
my command is
find ! [-mtime -60 -type f} | xargs ls -tg
but give me ...
- 08-05-2007 #1Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
list files not modify in last two month but give wrong result?!
I want to list all file that is not modify in last two month
my command is
find ! [-mtime -60 -type f} | xargs ls -tg
but give me wrong result with this error message
find: paths must precede expression
Usage: find [path...] [expression]
- 08-05-2007 #2Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
try this:
Edit: the above will list most of the files on the system.Code:find / ! -mtime -60 -type f | xargs ls -tg > files_list more files_list
If you want to list files in a directory (and subdirectories), then do it this way:
Code:cd directory find ./ ! -mtime -60 -type f | xargs ls -tg > files_list more files_list
- 08-05-2007 #3Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
It does not work
for first code
find / ! -mtime -60 -type f | xargs ls -tg > files_list
more files_list
give me this errore message
Permission denied
for second code
cd directory
find ./ ! -mtime -60 -type f | xargs ls -tg > files_list
more files_list
give me this errore message
Document: No such file or directory
- 08-05-2007 #4Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
- 08-05-2007 #5
- 08-05-2007 #6Just Joined!
- Join Date
- Jul 2007
- Posts
- 31
- 08-05-2007 #7Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
What is your OS? I just tested it on Debian, and it works fine.
- 08-05-2007 #8Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
Also, to run it as root, type:
and then the rest of the commands.Code:su
- 08-05-2007 #9Linux Enthusiast
- Join Date
- Jul 2005
- Location
- Maryland
- Posts
- 521
you can also create a file with the date you are interested in, and then run "find" command to search for files that were created before the date of that file. For example, create file 111 with the date 2007-06-05 00:00 and then run "find" command:
Edit: I meant "... search for files that were created no later than the date of that file".Code:touch 111 -t 200706050000 find ./ ! -newer 111 | xargs ls -tg > files_list more files_list
- 08-05-2007 #10Just Joined!
- Join Date
- Jul 2007
- Posts
- 31


Reply With Quote
