10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
$ find /opt/data_* -maxdepth 3 -type d -name "main*" 2> /dev/null
/opt/data_025/maindblogs
/opt/data_026/maindblogs
/opt/data_027/maindblogs
/opt/data_028/maindblogs
$ find /opt/data_* -maxdepth 3 -type d -name "rvlogs*" 2> /dev/null
/opt/data_002/prod/rvlogs2_archive... (4 Replies)
Discussion started by: urello
4 Replies
2. UNIX for Dummies Questions & Answers
Hi all,
Am wanting to do a ls -l of the files and do a cat of it at the same time, ideally, I am hoping that the following work but obvisouly it is not working to what I am wanting it to ... hu hu hu :wall:
find . -name "BACKUP_TIMESTAMP.log" -exec "ls -l basename {} ; cat {}" \;
... (1 Reply)
Discussion started by: newbie_01
1 Replies
3. Shell Programming and Scripting
Greetings,
Everytime I use rm with find I get errors like find: ./test: No such file or directory
For exemple :
hostname> mkdir test
hostname> ls
test
hostname> find . -type d -name test -exec rm -rf {} \;
find: ./test: No such file or directory
hostname>ls
hostname> echo $?
1
... (2 Replies)
Discussion started by: Sekullos
2 Replies
4. UNIX for Dummies Questions & Answers
Hello all,
Something strange going on with a shell script I'm writing. It's trying to write a list of files that it finds in a given directory to another file. But I also have a skip list so matching files that are in that skip list should be, well uhm, skipped :)
Here's the code of my... (2 Replies)
Discussion started by: StijnV
2 Replies
5. UNIX for Dummies Questions & Answers
I can't get this to work. Running a single command works fine:
find . -name "*.dat" -exec wc -l '{}' \;
gives me the file name and number of lines in each .dat file in the directory.
But what if I want to pipe commands, e.g. to grep something and get the number of lines with that pattern... (3 Replies)
Discussion started by: DJR
3 Replies
6. AIX
When I use "/" to look for a particular command that I typed in the current session it says
D02:-/home/user1/temp> /job
ksh: /job: not found.
D02:-/home/user1/temp>
previously it used to fetch all the commands which had job in it..
for example subjob, endjob, joblist etc...
may I... (7 Replies)
Discussion started by: meetzap
7 Replies
7. UNIX for Dummies Questions & Answers
I am using find to get all the instances of a given directory name, then remove those directories with a -exec rm command.
here is an example:
mkdir -p foo/bar
find foo -name bar -exec rm -rf {} \;
foo will get deleted as I desired, however this pops out on standard error:
find: foo/bar:... (3 Replies)
Discussion started by: Afifi
3 Replies
8. UNIX for Dummies Questions & Answers
Howdie everyone...
I have a shell script RemoveFiles.sh
Inside this file, it only has two commands as below:
rm -f ../../reportToday/temp/*
rm -f ../../report/*
My problem is that when i execute this script, nothing happened. Files remained unremoved. I don't see any error message as it... (2 Replies)
Discussion started by: cheongww
2 Replies
9. Shell Programming and Scripting
Hi There,
I have a script which finds for log files and removes them if the file has changed in the last day.
The script runs fine without errors. The log file is still there. So, I decided to print the find command and run the command outside the script. Getting "Incomplete statement"
Can you... (6 Replies)
Discussion started by: funtochat2002
6 Replies
10. UNIX for Dummies Questions & Answers
Using solaris 2.5.1, and how can I get a summary of the size of each subdirectory, say for /export/home, all the users? usually I do a du -sk dirname but I have to manually type in each name, is there a better way?
Thanks, (3 Replies)
Discussion started by: kymberm
3 Replies