Contents
How do you find a file that is a certain size in Linux?
- File size >= 100MB. Find all files that have a size >= 100MB, from root folder and its sub-directories. sudo find / -type f -size +100000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’
- File size >= 50MB. Find all files that have a size >= 50MB, from folder ‘/Users/mkyong’ and its sub-directories.
Where is all files older than 30 days Linux?
The above command will find and display the older files which are older than 30 day in the current working directorys….Find and delete files older than X days in Linux
- dot (.)
- -mtime – Represents the file modification time and is used to find files older than 30 days.
- -print – Displays the older files.
How do I find large files in Linux?
The procedure to find largest files including directories in Linux is as follows: Open the terminal application. Login as root user using the sudo -i command. Type du -a /dir/ | sort -n -r | head -n 20. du will estimate file space usage. sort will sort out the output of du command. head will only show top 20 largest file in /dir/.
How do I locate a file in Linux?
To find files in Linux terminal, do the following. Open your favorite terminal app. Type the following command:find /path/to/folder/ -iname *file_name_portion* The arguments above are as follows: If you need to find only files or only folders, add the option -type f for files or -type d for directories.
How to find large file size on Linux?
The procedure to find largest files including directories in Linux is as follows: Open the terminal application Login as root user using the sudo -i command Type du -a /dir/ | sort -n -r | head -n 20 du will estimate file space usage sort will sort out the output of du command head will only show top 20 largest file in /dir/
How to search files from the terminal on Linux?
Open your favorite terminal app.