searchhilt.blogg.se

Ubuntu find file sizes
Ubuntu find file sizes




This can be confirmed that they are empty using the du command. home/pratham/Documents/work/learn-ubuntu/mt_file_2qxurĪs you can see, the find command listed all matching results. Note that the -name (or -iname) option is not compulsory. To find those empty files, I will use the -empty flag and specify the type to be a file. I made a mistake in my bash script, and now it has created empty files all over my home directory. ) to search only in the current working directory. You may also substitute the tilde symbol ( ~) (for home directory) with the period symbol (. Here's the output: $ find ~ -name headshot.pngĪh! It was in the ~/Pictures/self directory. To find the photo, I would modify the find command's parameters as follows: find ~ -name headshot.png Let us assume I have a photo named 'headshot.png' located somewhere in my home directory. But, it does not even cover all the available options for the find command!įor better understanding, let us look at a few common examples of the find command. That is quite a list of available options. -writable: Only files that the current user can write to.

ubuntu find file sizes

  • -readable: Only files that the current user can read.
  • Use c, k, M and G for specifying units in bytes, kibibytes, mebibytes and gibibytes, respectively.

    ubuntu find file sizes

    Use d, f and l for a directory, file and a symbolic link, respectively. -mmin n: File was last modified n number of minutes ago.-amin n: File was last accessed n number of minutes ago.-iname: Same as -name, but case insensitive.-name: Specify a case-sensitive filename/regex for the file to search for.You can provide multiple options to the find command, so let us look at them. The find command is an amazing command line utility that searches for a given filename/regex pattern in a specified directory. There is more to the find command, so keep reading if you want to know more! find command The 'FILE_NAME' parameter can be replaced by the exact name of a file or by a regex.įor example, if I want to search for a file that is named 'resolution-for-year-2022.txt', only in my home directory, I would issue the following command: find ~ -name resolution-for-year-2022.txt Replace 'LOCATION' with a directory in which you wish to search.

    ubuntu find file sizes

    Ubuntu 18.04 Review of New Features find LOCATION -name FILE_NAME






    Ubuntu find file sizes