LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 12-31-2006, 08:29 PM   #1
gmcauley
LQ Newbie
 
Registered: Dec 2006
Posts: 9

Rep: Reputation: 0
Bash Expression: Current Directory & All Subdirectories Below


Hello,

I want to tell the bash (GNU bash 3.1.17) shell to find all .html files in all subdirectories (starting with and including the current directory).

'*.html' finds all in the current directory
'*/*.html' finds all in the first level subdirectories
'*/*/*.html' finds all in the second level, etc

How do I refer to 'all html files in all subdirectories below and including the current directory' in one expression?

Google searching reveals that in the Z shell '**/*.html' would work, but it seems that this does not work in Bash.

Any help would be appreciated.
 
Old 12-31-2006, 08:49 PM   #2
musicman_ace
Senior Member
 
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
find /home/username -iname '*.html'

That would work for me
 
Old 01-01-2007, 03:36 PM   #3
gmcauley
LQ Newbie
 
Registered: Dec 2006
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks musicman_ace.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Bash, Find script files in a directory or subdirectories within... ray5_83 Programming 4 10-10-2008 08:42 PM
Bash to find and disect current working Directory carl0ski Linux - General 4 10-28-2006 05:36 AM
cd keeps snapping back to current directory when called from bash script ghrellin Linux - General 5 08-28-2005 01:50 PM
setting bash to look in current directory before searching the path muhkuhmasta Linux - Newbie 4 09-21-2004 03:08 AM
BASH: How to get current workin directory? gmitra Programming 9 09-20-2003 11:30 PM


All times are GMT -5. The time now is 12:58 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration