How to Get File Creation Date/Time in Debian?
There are three methods to get the file creation date/time in Debian:
Method 1: By Using ls Command
The first method to get a file creation Date/time is by using the list (ls) command, which enlists the files along with the creation date/time. To get the file creation date/time using the list command, just run the below-written ls -l command after getting into the directory where the desired file is present:
In the output, all the files in the directory will be listed along with their creation date and time:
The other way to use this ls command is by using the name of the file along with the ls command:
This command will display only the date and creation time of the desired file and not the complete list of all the files present inside the directory:
For example:
Method 2: By Using “stat” Command
The other command to get file creation date/time in Debian is by using the stat command along with “%w” specifier to get the file creation information in a human-readable form. “stat” command in Linux system is used to print the status/attributes of file, follow the below-written syntax to get file creation date/time in Debian:
For example;
The output syntax of stat commands is <Date> <Time>
Method 3: By Using GUI
Another method to get the file creation time is a GUI method, this is the most preferred method for the users who like to do things via GUI.
To get the file creation time by using GUI, simply click on the Files option from the Activities Menu:
Then inside the Files find your desired file, and right-clicking on it will open a drop-down list select Properties:
The file properties will open, from where you can get the file creation and last accessed time. The Modified is the day/date/time when the file is created and the Accessed day/date/time is when the file is last accessed:
Conclusion
To get the file creation date/time in Debian there are three ways one is by using the “ls” command, other is the “stat” command and the final is GUI method. The ls command is used to list the files along with their creation date and time. Whereas, the “stat” command is used to print the status/attributes of files in Debian. Lastly, the GUI method is discussed which provides file creation data/time from the “Properties” option of a file.