- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: list certain files from another 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
тАО03-11-2003 06:16 AM
тАО03-11-2003 06:16 AM
list certain files from another directory
i.e. if I have done a 'cd' Im at my user level.
I now want to know if there are any files which start with fish dogs cats or mice in the /stage/intray directory....
quickest answer wins a virtual glass of red wine from bob the spods virtual wine cellar (which I am told is the best one in virtual city)
cheers!
bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:20 AM
тАО03-11-2003 06:20 AM
Re: list certain files from another directory
# ls /stage/intrag/dogs*
# ls /stage/intray/cats*
# ls /stage/intray/mice*
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:20 AM
тАО03-11-2003 06:20 AM
Re: list certain files from another directory
ls /stage/intray/fish*
ls /stage/intray/dogs*
etc...
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:21 AM
тАО03-11-2003 06:21 AM
Re: list certain files from another directory
ls -1 /stage/intray | grep -e ^fish -e ^dogs -e ^cat -e ^mice
You can use ls on any directory if you specify the directory you wish to view. The grep will only print lines that start with fish, dogs, cats, mice.
Further info on these commands is available in their respective man pages.
regards,
Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:23 AM
тАО03-11-2003 06:23 AM
Re: list certain files from another directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:23 AM
тАО03-11-2003 06:23 AM
Re: list certain files from another directory
ls /stage/whatever
than grep for whatever you're looking for..
ls /stage/whatever |grep cats
Is this what you mean?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:23 AM
тАО03-11-2003 06:23 AM
Re: list certain files from another directory
cd dir
find $PWD|grep -e fish -e dogs -e mice -e cats
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:26 AM
тАО03-11-2003 06:26 AM
Re: list certain files from another directory
Got that wrong
cd dir
ls -1|grep -e dogs =e fish -e cats -e mice
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-11-2003 06:56 AM
тАО03-11-2003 06:56 AM
Re: list certain files from another directory
Use find:
find /stage/intray \( -name "fish*" -o -name "dogs*" -o -name "cats*" -o -name "mice*" \) -type f
rgds, Robin