Sponsored Content
Top Forums Shell Programming and Scripting find command to use multiple -exec options Post 302456902 by rdcwayx on Sunday 26th of September 2010 07:59:17 PM
Old 09-26-2010
So you need find out the file quantities in each subfolder?

Not sure, why you have to make it in one find -exec.

Here is my script:
Code:
find . -type d |while read DIR
do
  COUNT=$(ls -l "$DIR" |grep -v ^d|wc -l)
  echo $COUNT "|" $DIR
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Multiple exec command s in a script

Hi everyone, I've been racking my brains for ages on this and need your help/advice. I am writing a script that is reading in file to process and putting them into a temporary file. The loop starts and the script gets the first file name, does what i needs to do (copy it) and then returns to... (2 Replies)
Discussion started by: Angoss
2 Replies

2. UNIX for Dummies Questions & Answers

Find command with prune and exec options

Hi, I'm using the following command to get a list of files on the system. find /releases -type f -exec ls -l > /home/sebarry/list.txt '{}' \; however, its searching a directory I don't want it to search so I know I have to use prune but I don't seem to be able to get prune and exec to work... (2 Replies)
Discussion started by: Sebarry
2 Replies

3. Shell Programming and Scripting

find command with -exec

Hi People, I have a directory full of compressed files (.Z extention) In many of these files there is a string pattern (3800078163033) I want to find all file names which contain this string in their text. Regards, Abhishek (2 Replies)
Discussion started by: max29583
2 Replies

4. UNIX for Dummies Questions & Answers

How to run multiple piped commands in a find -exec statement?

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

5. UNIX for Dummies Questions & Answers

Using find -exec with multiple commands :(-

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

6. Shell Programming and Scripting

find command with -exec

Hi all, Please could someone help with the following command requirement. I basically need to find files NEWER than a given file and order the result on time. My attempt so far is as follows: find . -newer <file_name> -exec ls -lrt {} ;\ But I dont seem to get the right result... (12 Replies)
Discussion started by: jonnyd
12 Replies

7. UNIX for Dummies Questions & Answers

What does the '\' in find -exec command

Hi, I have two scripts that remove files. One works fine and is coded find -name "syst*" -mtime +1 -exec rm {} \; The other is almost the same - only thing missing is the '\'. On that script though I keep getting: rm syst1202.file ? etc Does the \ make that difference or is it a... (3 Replies)
Discussion started by: Grueben
3 Replies

8. UNIX for Dummies Questions & Answers

UNIX find command - using multiple -name options

Hi all, What am trying do is search for a directory that is owned by cm that only exists in a path that has a particular directory ex: what I'm using now is find . -user cm -name '*.rel' -type d -exec ls -dl {} \; This is giving me stuff like this ./../../foo1/../../*.rel... (2 Replies)
Discussion started by: jtmed
2 Replies

9. Shell Programming and Scripting

Multiple search options in find command

Hi, I'd like find multiple file options to fetch different types of files. find /path...// -type f -name "*.log" -o -name "*.req" -o -name "*.txt" -mtime +5 -exec ls -l {} \; Where as in the above command only the last .txt files its retriving but not .log and .req files can body help... (1 Reply)
Discussion started by: Y.balakrishna
1 Replies

10. Shell Programming and Scripting

Linux find command seems to not transmit all the result to the '-exec command'

Hello. From a script, a command for a test is use : find /home/user_install -maxdepth 1 -type f -newer /tmp/000_skel_file_deb ! -newer /tmp/000_skel_file_end -name '.bashrc' -o -name '.profile' -o -name '.gtkrc-2.0' -o -name '.i18n' -o -name '.inputrc' Tha command... (3 Replies)
Discussion started by: jcdole
3 Replies
WV2-CONFIG(1)						      General Commands Manual						     WV2-CONFIG(1)

NAME
wv2-config - script to get information about the installed version of wv2 SYNOPSIS
wv2-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--libs] [--cflags] DESCRIPTION
wv2-config is used to determine the compiler and linker flags that should be used to compile and link programs that use wv2. OPTIONS
wv2-config accepts the following options. --prefix=DIR If specified, use DIR instead of the installation prefix that wv2 was built with when computing the output for the --cflags and --libs options. This option is also used for the exec prefix if --exec-prefix is not specified. This option must be specified before any --libs or --cflags options. If no DIR is specified then the current installation prefix will be written to standard out- put. --exec-prefix=DIR If specified, use DIR instead of the installation exec prefix that wv2 was built with when computing the output for the --cflags and --libs options. This option must be specified before any --libs or --cflags options. If no DIR is specified then the current installation exec prefix will be written to standard output. --version Print the currently installed version of wv2 on standard output. --libs Print the linker flags that are necessary to link a program against wv2. --cflags Print the compiler flags that are necessary to compile a program that uses wv2. SEE ALSO
Some documentation regarding the design of the wv2 library is available in /usr/share/doc/libwv2-dev/design/ . AUTHOR
The wv2 library was written by Shaheed Haque <srhaque@iee.org>, Werner Trobin <trobin@kde.org> and David Faure <faure@kde.org>. This manual page was prepared by Ben Burton <bab@debian.org> for the Debian GNU/Linux system, but may be used by others. June 2003 WV2-CONFIG(1)
All times are GMT -4. The time now is 08:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy