- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Find a word in a directory, never mind uppercase o...
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Knowledge Base
Forums
Discussions
- Cloud Mentoring and Education
- Software - General
- HPE OneView
- HPE Ezmeral Software platform
- HPE OpsRamp
Knowledge Base
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2010 10:12 AM
02-19-2010 10:12 AM
i need to get some paths.
This paths can contain the word:
Archive
ARCHIVE
archive
archivE
aRcChIvE
so, if i run:
find / -mtime +14 -exec ls -l {} \; | awk '{ print $3" "$4" "$6" "$7" "$8" "$NF }' | grep Archive
i only will get paths with a directory name called "Archive" so, how can i do in order to get above word indicated,i need to get them in only one instruction.
i mean,, i need to run command where i say "bring me paths which contain the word Archive never mind if they are uppercase or lowercase"
thansk in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2010 10:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2010 10:53 AM
02-19-2010 10:53 AM
Re: Find a word in a directory, never mind uppercase or lowercase
find / -mtime +14 -name "[Aa][Rr][Cc][Hh][Ii][Vv][Ee]" -exec ls -ld {} + |
awk '{ print $3, $4, $6, $7, $8, $NF }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2010 11:06 AM
02-19-2010 11:06 AM
Re: Find a word in a directory, never mind uppercase or lowercase
If you want *performance* you could use Perl's 'find' module:
# perl -MFile::Find -le '@dir=@ARGV?@ARGV:(".");find(sub{print $File::Find::name if m{archive}i && -M $_ > 14},@dir)' /path
You can change to the current directory and run this without any argument to examine it, or you can specify one or more '/path' arguments as above.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2010 02:32 PM
02-19-2010 02:32 PM