10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can you please help tweak the below command to exclude all directories with the name "logs" and "tmp"
find . -type f \( ! -name "*.tar*" ! -name "*.bkp*" \) -exec /usr/xpg4/bin/grep -i "user_1" /dev/null {} + >result.out
bash-3.2$ uname -a
SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v... (9 Replies)
Discussion started by: mohtashims
9 Replies
2. Shell Programming and Scripting
How can i tweak the below find command to exclude directory/s -> "/tmp/logs"
find . -type f \( ! -name "*.log*" ! -name "*.jar*" \) -printNote: -path option/argument does not work with the version of find that i have.
bash-3.2$ uname -a
SunOS mymac 5.10 Generic_150400-26 sun4v sparc sun4v (7 Replies)
Discussion started by: mohtashims
7 Replies
3. Shell Programming and Scripting
Using Sol 10 + KSH.
I need to run a find command on the whole system "/" and exclude a bunch of explicit directories and files that may or may not be on each system.
I cannot use the -name because i dont want to exclude all dirs named just specific paths.
-path/-wholename is not an option... (2 Replies)
Discussion started by: nitrobass24
2 Replies
4. UNIX for Dummies Questions & Answers
The below 'ls' command will list down files with extensions and suppress the ones with no extension
ls |grep "\\." But this dosen't work when I apply the same logic using 'find' command
find . -type f |grep "\\." I need help on how this logic can be implemented using 'find' command (3 Replies)
Discussion started by: meenavin
3 Replies
5. Shell Programming and Scripting
I had a Shell script that removes the files that are in a directory older than the specified days.
find /test/files -mtime +10
I would like to add another condition to the find command above that is to exclude any file starting with ‘CGU'
Thanks (1 Reply)
Discussion started by: db2dbac
1 Replies
6. Shell Programming and Scripting
Hi All,
First my OS version is:
ksh:0$ uname -a
SunOS 5.9 Generic_122300-48 sun4u sparc SUNW,Sun-Fire-V440
I want to exclude the following DIR(./country111) in my search pattern:
ksh:0$ find . -name "*.tar"
./country111/COUNTRY_BATCH-801.tar
./country111/COUNTRY_BATCH-802.tar... (3 Replies)
Discussion started by: saps19
3 Replies
7. Shell Programming and Scripting
Hi Forum.
I'm trying to write a script that finds and deletes files that are older than 300 days. The script will read a table that contains the following 3 columns:
1st col: “Y” means sub-directory scan; "N" means no subdirectory scan
2nd col: sub-directory location
3rd col: File prefix... (7 Replies)
Discussion started by: pchang
7 Replies
8. UNIX for Dummies Questions & Answers
Hi,
Can some one help me how to exclude multiple directories using find command..
I have the directory structure below.
/a/a1/b1
/a/c1/c2
/a/d1/d2/d3
I want to exlcude a1,c2and d3 from the above using find,can some one suggest pls..
thanks in advance...
Use code tags... (1 Reply)
Discussion started by: jagadish_gaddam
1 Replies
9. Shell Programming and Scripting
Hi,
A variable value is /home/samir/datas/data.txt
I want /home/samir/datas.
How can I get that. (11 Replies)
Discussion started by: samir_standing
11 Replies
10. UNIX for Dummies Questions & Answers
Howdy
I have this directory structure ...
eep
eepaptest
eepfatest
eepgltest
eep.old
eeppoptest
ehf
ehfaptest
ehfgltest
ehp
ehpgltest
I want to find files in these directories, but I want to exclude eep, ehf & ehp.
Cany anyone help with the correct command ?? (1 Reply)
Discussion started by: SmurfGGM
1 Replies