Using system tools – stat
While working on Linux, the most commonly used command is ls
, which gives a listing of the files in the directory we specified. However, it shows only a little information about the files.
Instead, if we use the stat
command, we can get more information about the files/directories when compared to using ls
. Because stat
is able to get information about a file from its node, it is able to give more information about the files.
Getting ready
Since stat
is a built-in command of Linux, nothing else is needed to be installed in order to use it.
How to do it…
This section will explain the options and usage of the stat
command. Using stat, we will can get the detailed status of a particular file or filesystem.
Suppose we have a file called
example.txt
. When we perform a long-listing of this file using thels -l
command, we get information about the file, which includes when the file was last modified.However, when we use the
stat
command to check the details of the same file...