Hi,
I have two scripts that remove files. One works fine and is coded
Code:
find -name "syst*" -mtime +1 -exec rm {} \;
The other is almost the same - only thing missing is the '\'.
Hi ,
I imported find command I have on my hp-ux server to clean up the /tmp of my new IBM AIX servers.
Though, the commands always fails in the cron but if I past it at the prompt, it works find.
Hi,
I need to delete the last N days file using find.
I am trying to use
find . -mtime -10 -print
which lists down required files.
but when i use
find . -mtime -10 -exec ls -lrt {} \;
it gives me all files in the directory including the required files but the required files are having ./ preceded with them.
Now when I tried
find .
Hi, I am trying to make a script that finds if inside a folder there are more than 2 subfolders; if so, I want to erase the older subfolder.
I thought this would be useful:
Code:
find /sdcard/backup -mtime +1 -exec rm-r {} /;
But it only erases subfolders older than one day, and I would want that subfolders get erased if there are more than two, even if none of them is older than one da
I have a bash script, exec.sh like
some command
expect test.exp
continue other command
in the test.exp file, I have a snippet like:
while {[gets $cmds command]>=0} {
send "$command\r"
expect {
"*OK*" {puts $vout $command}
"*fail*" {puts $iout $command}
"*blocked*" { what should I put here????}
}
}
so I want to put something in the curly bracket so that the executio
Hi ,
I am adding a line in my shell scripts to delete all the old directory with the below command. On running this command it is coming out with the message
find: incomplete statement
Code:
find /ersdg3/ERS/ERS_INPUT_LOGS/RIO/rio_archive -type d -mtime +47 -exec rm -rf {}
What is wrong or missing in it.
My os sun solaris 10
Guddu
I created a script,
Code:
size=`du -sm`
size=`echo $size | sed 's/.$//'`
size1='30720'
if [ $size -gt $size1 ]
then
{
find /ask/tarballs -type f -name "*.tgz" -mtime +30 -exec ls -l {} \;
find /ask/tarballs -type f -name "*.tgz" -mtime +30 -exec rm -f {} \;
}
else
echo "Directory size doesnt exceed Threshold Limit"
fi
==============
which is in th
i want to remove *.req files from directory
/opt/FFCL8001/oracle/inst/apps/FFCL8001_lhrho/logs/appl/conc/log
i executed command find . -name '*.req' -mtime +2 -exec rm {} \;
but it is running since hours and free space in /opt is same as old 7.4 GB .
why it is not removing files ?
Suppose I have a directory structure as follows
test
test/a
test/b
Now I want to execute a command, such that in the . folder I can execute a command on the basename of the files a and b.
So basically, I want something like this, which I naively tried
find test -type f -exec touch `basename {}` \;
Only, this does not result in empty files a and b in the parent directory.