- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Listing files
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
Forums
Discussions
Discussions
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
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
11-24-2004 06:53 PM
11-24-2004 06:53 PM
Listing files
(1.) Device_time_batch.txt
(2.) Device_time_
where: batch = 4 digit number
prefix = GS or anything
I need to list all devices only with batch and exclude / delete batch with prefix.
Maximum points to all correct replies!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2004 07:03 PM
11-24-2004 07:03 PM
Re: Listing files
$ ls -l Device_time_????.txt
Regards, MB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2004 07:32 PM
11-24-2004 07:32 PM
Re: Listing files
to remove the files with prefix use something like:
$ find . -type f -name 'Device_time_??????.txt' -exec rm {} \;
Regards, MB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2004 08:26 PM
11-24-2004 08:26 PM
Re: Listing files
Try simple find before you add 'rm' to it. Good thing is that you have "_" as the seperator so you may not have to worry too much.
find /directory -name "Device_time_[0-9][0-9][0-9][0-9].txt"
Assuming that your time doesn't include a "_" in it.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2004 04:18 PM
11-25-2004 04:18 PM
Re: Listing files
The first thing i would do before
$ find . -type f -name 'Device_time_??????.txt' -exec rm {} \;
that is to
$ find . -type f -name 'Device_time_??????.txt' -exec echo {} \;
Just as sanity sake to see what i will be impacting.
HTH
Gerhard