Solved

Why -newer option doesn't work in find command?

Posted on 1998-05-26
6
252 Views
Last Modified: 2010-04-21
I tried to find all the files which were created after a file /tmp/aaa, but it doesn't seem to give me the right answer. Here's what I did ( IRIX6.2):
1. ls -l /tmp/aaa
-rw-r--r--    1 root     sys            7 May 18 07:00 /tmp/aaa
2. stat /tmp/aaa
/tmp/aaa:
        inode 2099346; dev 33554704; links 1; size 7
        regular; mode is rw-r--r--; uid 0 (root); gid 0 (sys)
        st_fstype: xfs
        change time - Tue May 26 11:29:39 1998 <896200179>
        access time - Mon May 18 07:00:00 1998 <895492800>
        modify time - Mon May 18 07:00:00 1998 <895492800>

3. find / -local -newer /tmp/aaa -exec ls -l {} \;
drwxr-xr-x    2 root     sys            9 Feb 20  1997 CDROM
lrwxr-xr-x    1 root     sys            4 Feb 20  1997 debug -> proc
drwxr-xr-x   18 root     sys        12288 May 14 15:28 dev
drwxr-xr-x   19 root     sys        12288 May 18 15:20 etc
dr-xr-xr-x    1 root     sys          512 May 14 15:24 home
drwxr-xr-x    2 root     bin           43 May  8 08:10 krb5
drwxr-xr-x    2 root     sys           72 Nov 11  1997 lib
drwxr-xr-x    2 root     sys           39 Nov 11  1997 lib32
drwxr-xr-x    2 root     sys           21 Aug 25  1997 lib64
drwxr-xr-x    2 root     sys            9 Jan 29 06:28 mnt


Look at those dates! Those I expected should be later than May 18, right?
Please explain to me. Thanks.
Emay
0
Comment
Question by:Emay
  • 4
  • 2
6 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2007242
perhaps / itself is newer than /tmp/aaa?
try
 find / -local -newer /tmp/aaa -exec ls -ld {} \;
or
 find / -local \! -type d -newer /tmp/aaa -exec ls -ld {} \;

0
 

Author Comment

by:Emay
ID: 2007243
It worked! Thanks a lot!!
But I am not quit get it though. How come ls -ld worked but ls -l did not?
Thank you very much
Emay
0
 
LVL 84

Expert Comment

by:ozo
ID: 2007244
You could use something like
 find / -local \! -type d -newer /tmp/aaa -exec ls -l {} \;
(but then you don't get to see if / is newer than /tmp/aaa)
0
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

Author Comment

by:Emay
ID: 2007245
Thank you very much for your help
Emay
0
 
LVL 84

Accepted Solution

by:
ozo earned 50 total points
ID: 2007246
find / -local -newer /tmp/aaa -exec ls -ld {} \;
find / -local \! -type d -newer /tmp/aaa -exec ls -l {} \;
0
 
LVL 84

Expert Comment

by:ozo
ID: 2007247
Emay, was there anything else you needed?
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question