How to find or list file directories which having size more than 100 MB
I'm using du -sh*
to get the size of file but my system don't have permission
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityThis is a good article: How to Find Out Top Directories and Files (Disk Space) in Linux
One of the commands listed comes close to your directory needs:
$ du -Sh | sort -rh | head -20
8.0G ./Videos
990M ./.googleearth/Cache/unified_cache_leveldb_leveldb2
798M ./.cache/mozilla/firefox/9fu0cuql.default/cache2/entries
643M ./roboto/Kijiji
378M ./android-studio/lib
306M ./roboto
293M ./Pictures
195M ./.dropbox-dist/dropbox-lnx.x86_64-84.4.170
193M ./.cache/google-chrome/Default/Cache
193M ./Android/Sdk/emulator/qemu/linux-x86_64
177M ./android-studio/plugins/android/lib/layoutlib/data/fonts
131M ./.cache/thumbnails/large
130M ./android-studio/plugins/android/lib
102M ./.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg
101M ./Pictures/1920x1080
93M ./Android/Sdk/emulator
91M ./.mozilla/firefox/9fu0cuql.default
90M ./Android/Sdk/emulator/lib64/qt/lib
80M ./gmail
80M ./Downloads
Another of the commands comes close to solving your file size needs:
$ find -type f -exec du -Sh {} + | sort -rh | head -n 20
2.8G ./Videos/simplescreenrecorder-2019-11-24_17.20.17.mkv
1.3G ./Videos/simplescreenrecorder-2019-12-01_18.56.29.mkv
1.1G ./Videos/simplescreenrecorder-2019-11-30_16.16.22.mkv
1.1G ./Videos/simplescreenrecorder-2019-11-17_18.13.03.mkv
952M ./Videos/simplescreenrecorder-2019-11-11_21.42.51.mkv
548M ./Videos/simplescreenrecorder-2019-11-24_20.03.44.mkv
201M ./Videos/Screencapture 2019-11-08 at 13.07.14.mp4
122M ./Videos/Screencapture 2019-11-08 at 13.43.55.mp4
102M ./.gradle/wrapper/dists/gradle-4.6-all/bcst21l2brirad8k2ben1letg/gradle-4.6-all.zip
88M ./android-studio/lib/platform-impl.jar
66M ./android-studio/bin/lldb/lib/liblldb.so.7
63M ./android-studio/jre/jre/lib/rt.jar
62M ./.AndroidStudio3.2/system/caches/content.dat.storageData
61M ./android-studio/lib/idea.jar
57M ./.config/VirtualBox/VBoxGuestAdditions_5.1.38.iso
54M ./Documents/vio.mp4
48M ./android-studio/plugins/android/lib/android.jar
46M ./Downloads/linux-modules-4.14.153-0414153-generic_4.14.153-0414153.201911101449_amd64.deb
45M ./Android/Sdk/platforms/android-28/android.jar
42M ./android-studio/lib/java-impl.jar
In both examples, just tweak the number of lines listed to get files over 100 MB. For example change head -n 20
to head -n 40
to list double the number of files.
du -Sh --threshold=100M
to list only files & folders over 100MB (as asked)
You can simply use find
command in order to display only file which are bigger than 100 MB, like that :
sudo find -size +100000k
Explanation :
find -size
would display all files depending of -size
option parameter+100000k
would say bigger than 100 000 KB, which is 100 MBNB : if you aren't inside a subdirectory of your home directory or something like /home/user
or /media
, you need to use sudo
command, or you won't be able to list every files due to Permission denied
du
display all files and folders of the current directory without taking care size of files/folders, so I just add the find
command to filter the result
find
command will just search the current directory and ignore anything from stdin: The output of the du
command will be lost!
sudo
du
? Please, edit your question by adding more information, instead of replying in the comments.