![]() ![]() find /path/to/directory -type f -exec du -hs | sort -rh | head -n 1įinds all regular files starting from the root directory (“/”), calculates the disk usage for each file, sorts them in reverse order based on human-readable sizes, and displays the information of the largest file.The following commands can be used to find the largest files. We will be using the “du” command, the “find” command, and the “ls” command to find the largest files. Bryan Kohbergers attorney says there is 'no connection' between him and the four Idaho students he is accused of fatally stabbing and that other mens DNA was found at the scene of the crime. The commands work well in different scenarios. This is a handy trick to know if you are running out of disk space and need to free up some space. Table of Contents Looking for a specific file in your Ubuntu system There are several commands for finding files in the terminal. 2,117 3 3 gold badges 18 18 silver badges 27 27 bronze badges. This is also helpful in knowing which files take the most space on your system. mtime +10 -printf 's n m u g t p' ( -type l -printf -> ln -o -printf n ) sort -k1,1 -n See find manual, section Actions. To get a file's size, you can use wc -c to get the size (file length) in bytes: filefile. ![]() You can use the -S option of the ls command to sort files by size. 7 Answers Sorted by: 10 Provided that your file paths do not contain newline characters: find. You should combine with -h to show the file size in human readable form. In this blog post, we will discuss three different ways to find the largest files on a Linux system. -type f -size +100M If you want the current dir only: find. The ls command also has -s option to display size.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |