![]() The size of files obtained by the execution of the above command will lie within the range of 10kB to 50kB. Let’s try this out by executing this command to search for files greater than 10kB but smaller than 50kB: $ find. Yes, we are going to use "-size" twice!!! Once with the "+" sign and once with the "-" sign. To define a certain range for the file size, you can easily guess what we are going to do. As we have learned, the use of "+" and "-" signs with the file size in Kilobytes. We can also find a file by specifying a certain file size range. type f -size -100k -name *.confĪll the files in the output are configuration files with a size equal to or less than 100 Kilobytes. To display all the files with sizes less than 100 kilobytes and the “.conf” extension in its filename: $ find. Moreover, you can combine two or more flags in the find command to match your needs. One such flag is “-name”, which defines a pattern to specify the filename or extension you want to find. The find command also offers more flags that can aid the users in locating the desired files or directories in Linux. type f -size -200kįind Files Smaller Than Size 4. To find all files that are 200 Kilobytes or smaller in size, simply execute the following command: $ find. It’s time to discuss a similar case of searching for files equal to or less than the defined size by using the “-” sign before the file size. Now that you know how to search for files that have a file size equal to or larger than the mentioned file size. type f -size +1kįind Files Greater Than Size 3. Let’s execute this command mentioned below to find the regular files that have a size equal to or larger than 1 Kilobyte: $ find. Moving forward, we can also use the “+” symbol before the file size to locate all the files larger or equal to the defined file size. The output will display all the files which are exactly 50 Kilobytes in size. ![]() Let’s see an example, to find all the files that are exactly 50 kilobytes in size within the current directory and its subdirectories. Note: Regular files are common types of files that can store user data including text, binary data, and documents in Linux. For instance, if you’re looking for files that are exactly 60 kilobytes, you can enter “60k” as the size parameter. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |