How to find disk usage more than 70% and find largest in there?
CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm sure there have been many similar threads over the years.
Jokoenom,
Welcome to LQ. Please understand that all LQ members, yourself included are free volunteers, we're not paid support.
We're happy to help, but the way this forum works best is if you work along side and solve this problem, with our assistance. The few reasons for this, among many others, are that you'll learn and be capable of doing more and more over time, plus you'll also stand to gain a resolution of your problem or project along exactly the lines you need or would like. Because if someone emits out a copy of an old script that they used, it may have flaws, special cases/directories, or considerations that has nothing to do with your setup. Therefore something like that may cause more problems/confusion than it's worth.
So for starters, do you know anything about shell scripting? And what language would you consider to use, if not just bash?
Here are some BASH references, and in my signature, these references are in a blog, but also that blog covers some techniques for writing and working through shell scripts, which you may find useful, one of the most important statements says something like, "anything you can type into a command line, you can put into a bash script", please take the time to review and update us what you have in mind moving forwards:
I have tried this script, but I have not found exactly what I meant, what is needed is only to find the largest file from the filesystem which has 70% utilization.
AWK is a scripting language. So the script has to be within quotes. Here it is within single quotes ' so that the field numbers do not need to be escaped.
How can I display the largest file in the same script?
Finding the largest file will be the second script.
Can it be combined into the first script sir? So if there is a fileusage of more than xx% then look for and display the largest file with the head -10? thank you very much, iam sorry for bothering you.
Finding the largest file will be the second script.
Can it be combined into the first script sir? So if there is a fileusage of more than xx% then look for and display the largest file with the head -10? thank you very much, iam sorry for bothering you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.