Debian

How to Get File Creation Date/Time in Debian?

In Linux-based system such as Debian, file creation time is the time when a particular file is created, copied, or moved to a new destination, this is helpful for users to find the information about their important files in Debian. If you are looking for ways to get the file creation date/time in Debian then follow this article’s guidelines.

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:

ls -l

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:

ls -l <new_file>

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:

ls -l new_file.txt

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:

stat -c '%w' <file_name>

For example;

stat -c '%w' new_file.txt

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.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.