- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: command needed 3
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
тАО06-13-2007 12:35 PM
тАО06-13-2007 12:35 PM
1. to list only directory (in a directory ,
there may have file and subdirectory, i
want to list only subdirectory)
2. to find out total size (KB/MB) for a
specific file, eg : to find out total size
for *.t files
thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2007 01:46 PM
тАО06-13-2007 01:46 PM
Re: command needed 3
2) ls *.t | awk '{sum += ($5 + 0)}END {print sum}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2007 01:46 PM
тАО06-13-2007 01:46 PM
Re: command needed 3
2) ls -l *.t | awk '{sum += ($5 + 0)}END {print sum}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-13-2007 05:12 PM
тАО06-13-2007 05:12 PM
SolutionNot sure what you are saying, just list what you want. If you only want the name of the directory, add "-d".
$ ll subdirectory
>2. to find out total size (KB/MB) for a specific file, eg: to find out total size for *.t files
Use awk:
$ ll *.t | awk '{ total+=$5 } END { print "Total MB:", total/1000000 }'
Of course you may want (1024*1024) for MB.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-17-2007 11:18 PM
тАО06-17-2007 11:18 PM
Re: command needed 3
Hi ng,
Try ls -l | egrep '^d', to get a list of subdirectories in a folder.
Regards,
Vad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-18-2007 01:07 AM
тАО06-18-2007 01:07 AM
Re: command needed 3
No real reason to use egrep when grep will do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-26-2007 08:18 PM
тАО07-26-2007 08:18 PM
Re: command needed 3
Thanks to everybody..You guy are so helpful