Find command not working on AIX

Hello,

I am running find command in an AIX Server to find last 7 days modified directories/files.

[root@hostname] >cd /usr/openv/netbackup/db/class
[root@hostname] >ls -l
total 0
drwxr-xr-x    3 root     system          256 May 28 2014  Catalog-Backup
drwxr-xr-x    3 root     system          256 Sep 18 2012  CFGTU-700_OS
drwxr-xr-x    3 root     system          256 Feb 05 2015  PILOU-001_OS
drwxr-xr-x    3 root     system          256 Jun 30 2014  GRTYU
drwxr-xr-x    3 root     system          256 Oct 20 03:45 hostname_OS
drwxr-xr-x    3 root     system          256 Jul 18 2014  ps5000_OS
[root@hostname] >cd hostname_OS
[root@hostname] >ls -l
total 24
-rw-------    1 root     system          108 Aug 16 11:03 clients
-rw-------    1 root     system           12 Aug 16 10:11 includes
-rw-------    1 root     system          919 Oct 20 03:45 info
drwxr-xr-x    4 root     system          256 Oct 20 03:45 schedule
[root@hostname] >cd schedule
[root@hostname] >ls -l
total 0
drwxr-xr-x    2 root     system          256 Oct 20 03:45 Full
drwxr-xr-x    2 root     system          256 Oct 20 03:45 Incremental 

The below command is not returning results in AIX Server although in Linux server it is working fine.

[root@nlnbumst01] >find /usr/openv/netbackup/db/class -type d -mtime 0 -mtime -7
[root@nlnbumst01] > 

Could someone please help.

Thanks
Rahul

Hello rahul2662,

Could you please try following and let us know if this helps, as I haven't tested it as don't have AIX box with me.

 find -type d -mtime -7 -exec ls -ld {} \; 2>/dev/null
 

Above will give the directories details whichever are modified from last 7 days, if you need only names you could try following then.

 find -type d -mtime -7 2>/dev/null
 

Thanks,
R. Singh

Hello Ravinder,

Both the command didnt returned any output.

Rahul

Apologies for the mistake. I got Output from the command. Thanks for the help

@Ravinder, only GNU find defaults to . as the start directory! Unix find gives error if no start directory is given - here unfortunately suppressed with 2>/dev/null
The following lists files and directories with mtime less than 7 days:

find /usr/openv/netbackup/db/class -mtime -7 -ls
2 Likes

hello MadeinGermany,

I also provided the directory and then only it worked :slight_smile:

Thanks
Rahul