Linux Find command is used to search and locate the list of files and directories based on conditions you specify that match the arguments.
The procedure to find the largest files in a directory recursively using find command is as follows:
- Open the terminal application
- Login as the root user using the “sudo -s” command (required if you want to check all files including from another user / root privilege files)
- Type the below mentioned command and press enter
- “find” command will list out all files in directly recursively
- “sort” will sort out the output by file size (High to Low) of find command
- “head” will only show top 20 largest file
Command for finding largest files in directory recursively
sudo find / -type f -printf "%s %p \n" | sort -nr | head -20
Sample Output:
user@gtechhub:~$ sudo find /home -type f -printf "%s %p \n" | sort -nr | head -20
[sudo] password for user:
1277783550 /home/user/file1.zip
952528940 /home/user/file2.zip
76992513 /home/user/temp/scene.mkv
68116480 /home/user/test/phantomjs-2.1.1-linux-x86_64.tar
67932064 /home/user/test/phantomjs-2.1.1-linux-x86_64/bin/phantomjs
65886387 /home/user/test/file3.tar.gz
65886387 /home/user/file4.tar.gz
65886150 /home/user/file5_htdocs.tar.gz
45072792 /home/user/file6.tar
39779568 /home/user/incubator-pagespeed-ngx-1.13.35.1-beta/psol/lib/Release/linux/x64/pagespeed_automatic.a
39745960 /home/user/file7.zip
39666344 /home/user/file8.zip
35915371 /home/user/.cpan/Metadata
19215803 /home/user/file9.zip
18731756 /home/user/file10.zip
17078501 /home/user/file11.zip
15113371 /home/user/file12.zip
14570300 /home/user/file13.zip
14531204 /home/user/file14.zip
13022550 /home/user/file15.zip

Related Posts
-
cal - How to get monthly and yearly calendar in LinuxThe "cal" command displays a simple calendar with Linux / UNIX date and time. If no argument passed, then the current month is displayed. Month can specified as a number from 1 to 12. "cal" command without argument to get monthly calendar: Monthly calendar "cal" command with argument to get…
-
cd command in Linux / Unix'cd' is a Linux command to change the current working directory or folder of the terminal (Shell). Syntax: # cd [directory / folder name] cd: cd [-L|[-P [-e]]] [dir] Change the shell working directory. Change the current directory to DIR. The default DIR is the value of the…
-
Find out what Perl modules already installed on Linux SystemUse 'instmodsh' command to get a complete list of installed Perl modules on your Linux system and it provides an interactive shell type interface to query details of locally installed Perl modules. Open your terminal and type the following command: instmodsh Now, you will get the list of available commands…
-
Linux command to list out all installed fonts: fc-listfc-list lists fonts and styles available on the system using fontconfig. You can use fc-list to find out whether particular language font is installed or not. In this tutorial, I will show you how to list all installed fonts and also how to list installed fonts for a particular language…
-
How to get / list out installed PHP extension in Linux OSLinux widely uses operating system in the server side and client side. Operating system provides flexible options to install our custom packages and extensions based on our project requirement. Additionally, we can write our own shell scripts to automate our projects. PHP is used mainly in server-side application software along with various…
-
PHP: How to copy all files from one directory to anotherI will guide you to copy all files & sub directories of the directory to another directory using PHP copy() function. There are many other functions used to copy the content of one directory to another. copy() Functionopendir() Functionis_dir() Functionscandir( ) Functionreaddir() Function PHP code for copy multiple files from…
-
How to create new user account with home directory in Open SUSE LinuxTo create a new user account in Open suse, please use the below command. # useradd -g usergroup -p testpwd -d /home/testuser -m testuser Where, usergroup - With primary group /home/testuser - Home directory testuser - Login name testpwd - Password More information: useradd [options] LOGIN useradd -D useradd -D [options] Options for create…
-
Linux cURL Commandcurl is a tool / client to transfer data from or to a server and to get documents/files from or send documents to a server, using any one of the supported protocols (HTTP, HTTPS, FTP, FTPS, GOPHER, DICT, TELNET, LDAP or FILE). The command is designed to work without user…