Other *NIXThis forum is for the discussion of any UNIX platform that does not have its own forum. Examples would include HP-UX, IRIX, Darwin, Tru64 and OS X.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to list out only the files inside my directory /A/B/C and not the sub directories and
files inside them. What I am using is
find . -maxdepth 1 -type f -ctime +1
Unfortunately I am getting error as:
find: bad option -maxdpeth
Looks like my find is not supporting maxdepth.
Is there any other simple way to do this?
I don't prefer using ls as it causes problems when there are large number of files
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by User_123
Hi,
I want to list out only the files inside my directory /A/B/C and not the sub directories and
files inside them. What I am using is
find . -maxdepth 1 -type f -ctime +1
Unfortunately I am getting error as:
find: bad option -maxdpeth
Looks like my find is not supporting maxdepth.
Is there any other simple way to do this?
I don't prefer using ls as it causes problems when there are large number of files
I am using AIX flavor
First, it's NOT "urgent" for anyone. Second, your own error message is telling what the problem is - you misspelt "maxdepth".
And what does that even mean ? The error message plainly says that the option specified doesn't exist. I suggest you re-read the OP.
I suggest you go to the link I provided, where it shows that AIX doesn't have the -maxdepth option. As I already tried to tell you, I ALSO spotted the typo, and at first I thought that was the problem like you did.
Quote:
I DO know in fact it's NOT "urgent" for anyone here, my dinner is more "urgent", excuse me.
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by User_123
I am using AIX flavor
Did you look at the find(1) manpage on AIX? Perhaps that switch isn't available. It's been a long time (easily a couple of decades) since I worked on AIX but I still remember it being rather an odd duck amongst the various UNIX flavors. The manpages are there for a reason---use 'em.
Linux is pretty much UNIX but don't be fooled by thinking that all Linux commands will work on proprietary UNIXes. I recall scratching my head for several minutes while fielding an "urgent" support call from an admin halfway around the planet before I realized that they were trying to use a Linux command to change a setting for a Solaris user account. (In this case it actually was rather "urgent" as they were trying to lock down a user account for someone who'd been fired.)
GNU-extensions might not work in AIX. You (or your sysadmin) could install GNU!findutils though. Or you can write a script to filter the files. E.g. utility 'dirname' could be useful.
I suggest you go to the link I provided, where it shows that AIX doesn't have the -maxdepth option. As I already tried to tell you, I ALSO spotted the typo, and at first I thought that was the problem like you did.
I try not to wade into threads relating to an OS which I've no experience of... but find(1) in AIX must be pretty ancient, i.e. still directly descended from AT&T's original UNIX system V (proprietary) code?
I checked man pages for the major *BSD derived OS and as with Linux, they also have the -maxdepth option.
AIX is not a Linux, it's IBM's own version of System V Unix.
So a lot of the utilities (like, probably, find) will NOT be the GNU ones but the original Unix (System V) applications, which may support less options then the GNU ones.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.