- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- regex: exclude file from directory
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
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
тАО01-11-2004 11:38 PM
тАО01-11-2004 11:38 PM
regex: exclude file from directory
Hello,
I'm looking for a regex pattern which exclude a specific file/directory and match all others within an directory, example:
$ls -ld /rep/*
/rep/car
/rep/loft
/rep/andsoon
...
and I want to match all filename but not loft
The best I found is:
ls -ld /rep/[^l]*
which exclude all filename beginning by 'l' but not the string "^loft$".
Any idea ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2004 11:43 PM
тАО01-11-2004 11:43 PM
Re: regex: exclude file from directory
ls -ld /rep/* |grep -v loft
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2004 11:48 PM
тАО01-11-2004 11:48 PM
Re: regex: exclude file from directory
I forgot to tell you something:
This is for a veritas netbackup policy configuration which use regex library but not a pipe to grep.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-11-2004 11:51 PM
тАО01-11-2004 11:51 PM
Re: regex: exclude file from directory
^ means beginning of string
! means not.
try this:
ls -ld /rep/* | grep -v /rep/loft
greetings,
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-12-2004 12:00 AM
тАО01-12-2004 12:00 AM
Re: regex: exclude file from directory
btw, regular expressions and the way a shell evaluates file names are different. We need to know for sure, what veritas uses.
greetings,
Michael