Sponsored Content
Full Discussion: recursive wc on a directory?
Top Forums UNIX for Dummies Questions & Answers recursive wc on a directory? Post 302326938 by pludi on Friday 19th of June 2009 07:44:44 AM
Old 06-19-2009
Simple and fast:
Code:
find /topleveldirectory/ -type f -exec wc -l {} \; | awk '{total += $1} END{print total}'

No loops, no whitespace problems, no unnecessary cat
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

non recursive search in the current directory only

Hi, Am trying for a script which should delete more than 15 days older files in my current directory.Am using the below piece of code: "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/ls -altr {} \;" "find /tmp -type f -name "pattern" -mtime +15 -exec /usr/bin/rm -f {} \;" ... (9 Replies)
Discussion started by: puppala
9 Replies

2. Programming

recursive copy of the directory

I want to copy a directory recursively ( it again has directories) and the directory is on windows and is nfsmounted in vxWorks, i am using unix to develop the code for this, can any one suggest me how to copy the directories recursively. (7 Replies)
Discussion started by: deepthi.s
7 Replies

3. UNIX for Dummies Questions & Answers

recursive directory listing with ownership

i'm playing around with "ls" and "find" and am trying to get a print out of directories, with full path, (recursive) and their ownership.... without files or package contents (Mac .pkg or .mpkg files). I'd like it simply displayed without much/any extraneous info. everything i've tried, and... (5 Replies)
Discussion started by: alternapop
5 Replies

4. Programming

Recursive remove directory.

What is the best way to completely remove dir with it's content ??? rmdir deletes only EMPTY dirs as i know. The man page of remove function says "remove() deletes a name from the file system." Can it remove any dir recursively ??? :rolleyes: (7 Replies)
Discussion started by: Trump
7 Replies

5. UNIX for Advanced & Expert Users

Recursive directory search using ls instead of find

I was working on a shell script and found that the find command took too long, especially when I had to execute it multiple times. After some thought and research I came up with two functions. fileScan() filescan will cd into a directory and perform any operations you would like from within... (8 Replies)
Discussion started by: newreverie
8 Replies

6. UNIX for Dummies Questions & Answers

recursive copy into a directory and all its subdirectories...

I want to copy a file from the top directory into all the sub-folders and all of the sub-folders of those sub-folder etc. Does anyone have any idea how to do this? Thanks in advance of any help you can give. (3 Replies)
Discussion started by: EinsteinMcfly
3 Replies

7. UNIX for Beginners Questions & Answers

Chattr recursive exclude directory

Attempting to recursive chattr directories while excluding a directory, however the command which works with chown does not seem to with chattr find /mysite/public_html ! -wholename '/mysite/public_html/images' -type d -exec chattr -R +i {} \; find /mysite/public_html -not -path "*/images*"... (2 Replies)
Discussion started by: carnagel
2 Replies
Authen::Simple(3pm)					User Contributed Perl Documentation				       Authen::Simple(3pm)

NAME
Authen::Simple - Simple Authentication SYNOPSIS
use Authen::Simple; use Authen::Simple::Kerberos; use Authen::Simple::SMB; my $simple = Authen::Simple->new( Authen::Simple::Kerberos->new( realm => 'REALM.COMPANY.COM' ), Authen::Simple::SMB->new( domain => 'DOMAIN', pdc => 'PDC' ) ); if ( $simple->authenticate( $username, $password ) ) { # successfull authentication } DESCRIPTION
Simple and consistent framework for authentication. METHODS
o new This method takes an array of "Authen::Simple" adapters. Required. o authenticate( $username, $password ) Returns true on success and false on failure. SEE ALSO
Authen::Simple::ActiveDirectory. Authen::Simple::CDBI. Authen::Simple::DBI. Authen::Simple::FTP. Authen::Simple::HTTP. Authen::Simple::Kerberos. Authen::Simple::LDAP. Authen::Simple::NIS. Authen::Simple::PAM. Authen::Simple::Passwd. Authen::Simple::POP3. Authen::Simple::RADIUS. Authen::Simple::SMB. Authen::Simple::SMTP. Authen::Simple::SSH. AUTHOR
Christian Hansen "chansen@cpan.org" COPYRIGHT
This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-19 Authen::Simple(3pm)
All times are GMT -4. The time now is 08:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy