- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Need Only file names from the ll Output
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
тАО04-27-2011 10:06 PM
тАО04-27-2011 10:06 PM
I am working on a script. I need to open files whose filenames has the word Password_Expiry one by one in a particular path.
server:\>ll | grep -i Password_Expiry
-rw------- 1 glance users 22 Apr 28 11:26 Password_Expiry_A
-rw------- 1 glance users 22 Apr 28 11:26 Password_Expiry_B
Now I need to login to each file one by one. How will I be able to do it?
Is there any command which gives me output like below?
Password_Expiry_A
Password_Expiry_B
Kindly help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2011 10:10 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2011 10:46 PM
тАО04-27-2011 10:46 PM
Re: Need Only file names from the ll Output
ls -1 | grep Password_Expiry
Or with awk:
ll | awk '/Password_Expiry/{print NF}'
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-27-2011 11:23 PM
тАО04-27-2011 11:23 PM
Re: Need Only file names from the ll Output
"-name 'Password_Expiry*'". As always, there
are details, but it seems a shame to get all
that "ls -l" info and then ignore it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-28-2011 04:30 AM
тАО04-28-2011 04:30 AM
Re: Need Only file names from the ll Output
I must add that Steven's point(er) is well-taken.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2011 03:03 PM
тАО04-29-2011 03:03 PM
Re: Need Only file names from the ll Output
Of course "ls *Password_Expiry_*" or "ls | grep -i Password_Expiry" work too.
Also the shell: echo Password_Expiry_*
(With suitable checks for no matches.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-30-2011 12:06 AM
тАО04-30-2011 12:06 AM
Re: Need Only file names from the ll Output
ll {}\; | awk '{print $6} | more
Thanks
Manix