- #1
- 2,128
- 32
How do you list creation date of a file in linux bash? I want to find creation date of some files, not just modification date. Thanks.
stat -c %W filename
stat -c %w filename
mount -p
/etc/mnttab
cd /path/to/content
ls -ltc *.whatever # files in order most recent -> oldest and shows ctime
ls -ltrc *.something # files in order oldest -> most recent and shows ctime
jim mcnamara said:ctime will do for most of what creation time does.
A list file creation date in bash refers to the date and time that a file was created or last modified. This information is stored in the file's metadata and can be accessed using the bash command stat
.
To list the creation date of a file in bash, you can use the stat
command followed by the name of the file. The output will include the file's creation date, as well as other information such as the file's size and permissions.
Yes, you can specify the date format for the creation date in bash by using the --format
flag with the stat
command. You can choose from a variety of date formats, such as %x
for the date in the current locale's format or %y
for the year in two digits.
Yes, you can list the creation date of multiple files in bash by using the stat
command with the -c
flag and a specified format, followed by a list of file names. This will display the creation date of each file on a separate line.
To use the creation date of a file in a bash script, you can use the stat
command with the -c
flag and a specified format, and then assign the output to a variable. This variable can then be used in your script for further processing or manipulation.