find large files in root filesystem and exclude others


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers find large files in root filesystem and exclude others
# 1  
Old 08-18-2011
find large files in root filesystem and exclude others

I am wondering if there is a way to search for top 10 files in size in root filesystem but exclude all other mounts including nfs mounts .
For example excluded

/var
/boot
/app
/app1
/u01/
# 2  
Old 08-18-2011
-mount tells find not to descend into other filesystems.
Code:
find / -mount -type f | xargs du | sort -r -n -k 1 | head -n 10

Depending on your system and version of find, it may be possible to cut out the xargs du step by having find print the file sizes itself.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find Large Files Recursively From Specific Directory

Hi. I found many scripts in the web of achieving this. But I like to use this one find /EDWH-DMT03 -xdev -size +10000 -exec ls -la {} \;|sort -n -k 5 > LARGE.rst But the problem is, why it still list out files with 89 bytes as the output? Is there anything wrong with the command? My... (7 Replies)
Discussion started by: aimy
7 Replies

2. Shell Programming and Scripting

Find large files

All, I'm running a simple find for large files in a bash shell that works fine: find <dir> -xdev -ls | awk '{print $7,$8,$9,$10,$11}' | sort -nr | head It gives me everything I want: file size, time stamp, and file name. However, I'd like to have the file size in human readable form. ... (4 Replies)
Discussion started by: hburnswell
4 Replies

3. UNIX for Dummies Questions & Answers

Find command to exclude files with no extension

The below 'ls' command will list down files with extensions and suppress the ones with no extension ls |grep "\\." But this dosen't work when I apply the same logic using 'find' command find . -type f |grep "\\." I need help on how this logic can be implemented using 'find' command (3 Replies)
Discussion started by: meenavin
3 Replies

4. Ubuntu

[Solved] Using Find with an exclude/exclude file

I am familiar with using tar and exclude/include files: tar zcf backup.dirs.tgz --files-from=include.mydirs --exclude-from=exclude.mydirs --no-recursion but was wondering if I could use find in the same way. I know that you can just specify the directories to exclude but my list is... (2 Replies)
Discussion started by: metallica1973
2 Replies

5. Shell Programming and Scripting

Using find in a directory containing large number of files

Hi All, I have searched this forum for related posts but could not find one that fits mine. I have a shell script which removes all the XML tags including the text inside the tags from some 4 million XML files. The shell script looks like this (MODIFIED): find . "*.xml" -print | while read... (6 Replies)
Discussion started by: shoaibjameel123
6 Replies

6. UNIX for Advanced & Expert Users

Find common Strings in two large files

Hi , I have a text file in the format DB2: DB2: WB: WB: WB: WB: and a second text file of the format Time=00:00:00.473 Time=00:00:00.436 Time=00:00:00.016 Time=00:00:00.027 Time=00:00:00.471 Time=00:00:00.436 the last string in both the text files is of the... (4 Replies)
Discussion started by: kanthrajgowda
4 Replies

7. UNIX for Advanced & Expert Users

How to find the time a filesystem was mounted without using root privileges

Hi, Im running RHEL. How do I find the time a particular filesystem was mounted? Please Let me know Thanks (1 Reply)
Discussion started by: neuralninja
1 Replies

8. Filesystems, Disks and Memory

How to find the time a filesystem was mounted without using root privileges

Hi, Im running RHEL. How do I find the time a particular filesystem was mounted? Please Let me know Thanks (1 Reply)
Discussion started by: neuralninja
1 Replies

9. Shell Programming and Scripting

Script for Deleting Core files on root filesystem

ok i am setting up a script to run daily using crontab. This script will search the root filesystem and delete any and all core files. I have set up this script The only problem i get with this script is it searches for directories and attempts to delete them. Since i have probably... (7 Replies)
Discussion started by: rgfirefly24
7 Replies

10. UNIX for Dummies Questions & Answers

Need to find large files

I have found the following code on this forum ls -lh | awk '{print $5,$9}' | sort -n Its purpose is to show a list of files in a dir sorted by file size. I need to make it recursive ls -lhR | awk '{print $5,$9}' | sort -n The problem is that there are lots of files on the... (3 Replies)
Discussion started by: jadionne
3 Replies
Login or Register to Ask a Question