- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Listing space of all files in all directories ...
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
тАО07-28-2008 05:32 AM
тАО07-28-2008 05:32 AM
Listing space of all files in all directories into a file
E.G in directory - /dnbusr1/gbid/gbid01 have the following files
-rw-r--r-- 1 gbx gbx 227 Feb 12 01:22 error
-rw-r--r-- 1 gbx gbx 0 Feb 12 01:22 sucess
-r--r--r-- 1 gbx gbx 4230 Jun 29 05:58 ph25dh00
-r--r--r-- 1 gbx gbx 2088140800 Jun 29 05:58 ph25dd00
-r--r--r-- 1 gbx gbx 7154 Jun 29 05:58 ph25df00
-r--r--r-- 1 gbx gbx 6004 Jun 29 05:58 ph25df00.eng
So my file will contains file name (error) and it's size (error)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2008 05:39 AM
тАО07-28-2008 05:39 AM
Re: Listing space of all files in all directories into a file
du -sk /dnbusr1/gbid/gbid01 will give the total for the directory
du -sk /dnbusr1/gbid/gbid01/* will give the size of each of the files (and subdirectories)
That may be what you are looking for.
Pete
Pete
- Tags:
- du
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-28-2008 05:46 AM
тАО07-28-2008 05:46 AM
Re: Listing space of all files in all directories into a file
You could do this:
# cat .report
#!/usr/bin/sh
typeset DIRLIST=$1
typeset DIRINFO=$2
while read DIR
do
ls -l ${DIR}/error | awk '{print $5, $9}'
done < ${DIRLIST} > ${DIRINFO}
...run as:
# ./report ./mydirs ./myoutput
...where the input file ./mydirs is a simple list of the directories you want to examine:
# cat ./mydirs
/home/panpaliya
/dnbusr1/gbid/gbid01
/dnbusr2/gbid/gbid02
...and ./myouput will be as requested.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2008 03:53 AM
тАО08-03-2008 03:53 AM
Re: Listing space of all files in all directories into a file
find /dnbusr1/gbid/ -type f -exec ll {} \; |awk '{print $9 , $5}' > /var/tmp/dnbusr1.txt
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2008 05:37 AM
тАО08-03-2008 05:37 AM
Re: Listing space of all files in all directories into a file
A very simple script ::::
##How to get total file size of all files in each directory under /dnbusr1/gbid
for x in `ll /dnbusr1/gbid |awk '{$NF}'`
do
echo "Total File size of directory /dnbusr1/gbid/$x is following" >> /tmp/spacedetails.file
du -sk /dnbusr1/gbid/$x >> /tmp/spacedetails.file
echo "######################"
done
Then run
cat /tmp/spacedetails.file