Sponsored Content
Top Forums Shell Programming and Scripting Maxdepth command not working in AIX.Need alternative solution for this command Post 302888340 by kommineni on Thursday 13th of February 2014 11:58:14 PM
Old 02-14-2014
Maxdepth command not working in AIX.Need alternative solution for this command

Hi All,

I am trying to select 30 days older files under current directory ,but not from subdirectory using below command.
Code:
find  <Dir> -type f -mtime + 30

This command selecting all the files from current directory and also from sub directory .

I read some documention through internet , most of them suggested to use "-maxdepth" command. but this command is not working in AIX .
kindly help me for any other alternative solution ?

Last edited by Franklin52; 02-14-2014 at 03:15 AM.. Reason: Please use code tags
 

9 More Discussions You Might Find Interesting

1. AIX

prtconf command not working in Aix 5.3

put prtconf command,after show this error message: bash-3.00# prtconf /usr/sbin/prtconf: msize=msize + 12544^J12544: syntax error pleae help me...........waiting for replay by mohan.s Aix sysadmin (deleted email, rule violation) (2 Replies)
Discussion started by: smohan62
2 Replies

2. AIX

maxdepth in avaible for AIX?

Hi, I'm trying to do a search in a directory on AIX and I was wondering if there's an equivelant option to the -maxdepth option to tell how far down to search. I ran this but I just want to make sure it's actually searching everything: find ./* -type f -name "090817*" -exec ls -l {} \; (1 Reply)
Discussion started by: bbbngowc
1 Replies

3. Shell Programming and Scripting

Need help! command working ok when executed in command line, but fails when run inside a script!

Hi everyone, when executing this command in unix: echo "WM7 Fatal Alerts:", $(cat query1.txt) > a.csvIt works fine, but running this command in a shell script gives an error saying that there's a syntax error. here is content of my script: tdbsrvr$ vi hc.sh "hc.sh" 22 lines, 509... (4 Replies)
Discussion started by: 4dirk1
4 Replies

4. UNIX for Dummies Questions & Answers

I want alternative of -maxdepth 1 for all Linux,Solaris and AIX

find /full/path/dir \( ! -name dir -o -type f \) -prune -type f on AIX it worked perfect : sdp1:/var/tmp/test# find /var/tmp/test/ \( ! -name test -o -type f \) -prune \ -name "*properties" -type f -exec ls -l {} \; -exec cksum {} \; -rw------- 1 root system 19 Dec 12... (5 Replies)
Discussion started by: laxmikant.hcl
5 Replies

5. Shell Programming and Scripting

sed Command not working in AIX UNIX

Hi 1st problem -------------- i have this sed command in my unix script which replaces new line and carriage return in a line with the string "&#xA" the script works fine in Linux 3.0.101-0.5, but not in AIX 1 7 , the "s/\r/\&#xA/g" replacement, replaces all the character "r" in the file.... (3 Replies)
Discussion started by: maximus_jack
3 Replies

6. Shell Programming and Scripting

Maxdepth option of find command not working

Can you please figure out what is the issue here $ find . -maxdepth 1 -type f -size 0 -print find: bad option -maxdepth please find the OS details $ uname -a HP-UX g5u1216 B.11.31 U ia64 2614088426 unlimited-user license Use code tags, thanks. (6 Replies)
Discussion started by: TomG
6 Replies

7. Shell Programming and Scripting

Find command not working on AIX

Hello, I am running find command in an AIX Server to find last 7 days modified directories/files. >cd /usr/openv/netbackup/db/class >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 ... (4 Replies)
Discussion started by: rahul2662
4 Replies

8. Shell Programming and Scripting

Execute ssh command with additional terminal command to any remote user not working script

Hello i am having an issue with bash script and this is the code now=$(cat hosts1.txt | awk '{print $2;}') while read n ;do ssh root@$now 'useradd test1; echo -e "test1\ntest1" | passwd test1 && echo "test1 ALL=(ALL:ALL) ALL" >> /etc/sudoers' When i execute only part with cat, it... (8 Replies)
Discussion started by: tomislav91
8 Replies

9. UNIX for Beginners Questions & Answers

Alternative to cp command

Good Afternoon, I'm backing up a folder from one NAS to another using a unix script using cp. Its a lot of files and takes several days to complete. Most of the files don't change from week to week. Is there a command that would be quicker? Also note, the backup needs to be ready-to-use in... (5 Replies)
Discussion started by: Stellaman1977
5 Replies
mdel(1) 						      General Commands Manual							   mdel(1)

NAME
mdel - mtools utility to delete a DOS file SYNOPSIS
mdel [-v] msdosfile [msdosfiles...] OPTIONS
Specifies verbose mode. File names are echoed as they are processed. DESCRIPTION
The mdel command deletes a file or files on an DOS file system. Unlike the DOS convention, multiple arguments can be specified. If a read only file is encountered, the mdel command queries whether or not to delete the file. Unlike the DOS convention, DOS subdirectory names that contain the '/' or '' separator are supported. If you use the '' separator or wildcards, you must enclose file names in quotes to protect them from the shell. The mcd command can be used to establish the device and the current working directory (relative to DOS), otherwise the default is A:. EXIT STATUS
The following exit values are returned: Success. Failure. ENVIRONMENT VARIABLES
The following environment variables affect the execution of mdel: If set, this variable names the file that contains the name of the cur- rent mtools working directory as established by the mcd command. If this variable is not set, the file $HOME/.mcwd is used. FILES
Contains the name of the current mtools working directory as established by the mcd command. If this file does not exist, the default mtools working directory is A:. Executable file SEE ALSO
Commands: mcd(1), mtools(1) mdel(1)
All times are GMT -4. The time now is 07:26 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy