![]() If you would like just the path and filename, then omit the -ls. In the above commands, the -ls command will display the file size, date, and other attributes regarding the file. It can be omitted on standard compliant find implementations. Using find to show files above a certain size (1,000,000 bytes 1M) find. -print is the action to perform with matching files.-size 0 only includes files with a size of 0 (the same in all units, for non-zero values, c needs to be included to check the file size in bytes).-name 'glob*' limits it to file that have name matching glob* (filenames starting with glob).-type f limits it to files (no directories or symlinks)."$dir" gets substituted by the shell with the value of the dir variable (as from question).On most implementations, the -print parameter can be omitted, if it is not specified, find defaults to printing matching files. ![]() Some find implementations does not require a directory as the first parameter (some do, like the Solaris one) and will default to the current working directory (. You can use find "$dir" -type f -name 'glob*' -size 0 -print Find will include all files and directories under the paths given as parameters, filtering them based on rules given as additional parameteres.
0 Comments
Leave a Reply. |