This command finds all empty files and directories (i.e., -type f,d) within the /tmp folder, as shown:īut which is which? As above, we can use -printf and column as follows: sudo find /tmp -empty -type f,d -printf "%p %y %s bytes\n" | column -t findįor the find command, this task is straightforward: sudo find /tmp -empty -type f,d Finding empty filesĪ number of the commands mentioned above have options specifically for finding empty files. The du or find commands are more appropriate for such a task. GNOME's desktop Files application provides typical GUI results:Īs can be seen above, sorting by the Size column isn't entirely helpful with respect to finding all files larger than 50 MiB. locateīecause the locate command's database does not contain file size information, you can't list files larger than 50 MiB solely with locate. In the above, %k provides the file size in KiB (as opposed to %s bytes). A more accurate rendition follows: sudo find / -size 50M -printf "%p %y %k KiB\n" 2>
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |