- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to use "ls" to search the biggest files in...
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
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
12-25-2002 05:40 PM
12-25-2002 05:40 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 06:03 PM
12-25-2002 06:03 PM
Solutionwill show largest files first
# ls -l | sort +4n
will show largest files last
If you want the whole /var directory structure use 'ls -lR' in the above command lines.
It would probably be easier to use du to do this though.
# du -k * | sort
should get you something close to what you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 06:06 PM
12-25-2002 06:06 PM
Re: how to use "ls" to search the biggest files in /var?
syntax...
find /var -size +1000000c -exec ll {} \;
this will list all files greated than 1MB.
For more information do man on find command.
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 06:12 PM
12-25-2002 06:12 PM
Re: how to use "ls" to search the biggest files in /var?
The syntax for the du command with sort is:
# du -k * | sort -n
Will sort smallest to largest
# du -k * | sort -nr
Will sort largest to smallest
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 07:11 PM
12-25-2002 07:11 PM
Re: how to use "ls" to search the biggest files in /var?
#du -k /var|sort -nr
This will list the greater MB size in descending order.
WHat you can check is for
check for these dir
/var/adm/crash
/var/tombstones
/var/adm/syslog/
/var/mail
/var/adm/wtmp
/var/opt/ignite
ALso you can clean the /var/tmp
remove the files which were not accessed for the past 7 days
find /var/tmp -atime +7 -exec rm {} \;
REmove the unrequired files and clean the file system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 07:50 PM
12-25-2002 07:50 PM
Re: how to use "ls" to search the biggest files in /var?
As mentioned, du -k is the preferred command because it shows the biggest directories. Once you see the biggest directories, look inside the directory and sort files by size using:
ll | sort -rnk5 | more
Files that will grow very large are logfiles in /var/adm and also /var/adm/sw where patches and other rollback files are stored. /var/adm/sw is always a candidate for a separate volume.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 08:41 PM
12-25-2002 08:41 PM
Re: how to use "ls" to search the biggest files in /var?
concerning du:
i prefer to use the -s option which allows me to print only the grand total of disk usage for each of the specified name operands.
E.g.
# du -sk /var/*
0 /var/X11
282551 /var/adm
20 /var/dt
0 /var/lost+found
255 /var/mail
0 /var/news
55453 /var/opt
1441 /var/preserve
0 /var/rap
0 /var/rbootd
2 /var/run
23428 /var/sam
403 /var/spool
2 /var/statmon
15106 /var/stm
17714 /var/tmp
402 /var/tombstones
0 /var/uucp
40 /var/yp
#
Then i drill down the directories in search for any suspicious files.
Please note that in SAM->Routine Tasks you already have a list of selected OS logfiles that alleviates the logfile trimming tasks of SysAdmins.
Cheers
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 08:53 PM
12-25-2002 08:53 PM
Re: how to use "ls" to search the biggest files in /var?
*.raw files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 09:15 PM
12-25-2002 09:15 PM
Re: how to use "ls" to search the biggest files in /var?
Before you delete any raw logfile file, you must find out WHY its got so big! Each file is written to every time a significant hardware event occurrs, so it could be some component on your system is failing.
Before deleting any file, you should first tell STM to start using a new log.
Please see the following post:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x20e191ccb36bd611abdb0090277a778c,00.html
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x5b3d7b8d1de3d5118ff40090279cd0f9,00.html
Cheers
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2002 09:41 PM
12-25-2002 09:41 PM
Re: how to use "ls" to search the biggest files in /var?
#> logfile
to empty the log file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2002 06:13 AM
12-26-2002 06:13 AM
Re: how to use "ls" to search the biggest files in /var?
logN.raw.cur
memlog
memlog is used for memory logging.
logN.raw.cur is the current log file for stm.
However you can delete the other old log files provided you will miss the old data.
check this link on the stm logging.
http://www.docs.hp.com/cgi-bin/otsearch/getfile?id=/hpux/onlinedocs/diag/logtool/log_data.htm&searchterms=/var/stm/logs/os&queryid=20020218-001728
Revert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2002 05:55 AM
12-27-2002 05:55 AM
Re: how to use "ls" to search the biggest files in /var?
ls -l | awk '{printf("%10s:%s\n",$5,$0)}' | sort | cut -c12-
In my case, I 'cd' to a directory and run 'biggest' ... it displays the biggest files with formatted output.
If you wanted something that would traverse directories, you could use this as a starting point.
Fred
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-27-2002 06:18 AM
12-27-2002 06:18 AM
Re: how to use "ls" to search the biggest files in /var?
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com