


How to find file creation time (crtime) in Linux
The file creation time is stored in the inode of the ext4 file system. Earlier versions of the ext file system did not support file creation time. There is a crtime (creation time) timestamp in the debugfs stat output. Finally, ext4 supports creation time, just like btime in ntfs windows.
You can follow the instructions below to find the file creation time. For example, I'm using one to select an existing file or create a new file for testing. For this file.
Step 1: Find the inode file number
First, use the following command on the terminal to find the inode number of any file.
$ ls -i /var/log/secure 13377/var/log/syslog
Step 2: Find the file creation time (crtime)
After obtaining the inode number of the file, use the debugfs command with inode number statistics to follow the disk path.
$ debugfs -R 'stat <inode_number>' /dev/sda1
Execute
$ debugfs -R 'stat <13377>' /dev/sda1 debugfs 1.41.12 (17-May-2010) Inode: 13377 Type: regular Mode: 0600 Flags: 0x80000 Generation: 2326794244 Version: 0x00000000:00000001 User: 0 Group: 0 Size: 223317 File ACL: 0 Directory ACL: 0 Links: 1 Blockcount: 440 Fragment: Address: 0 Number: 0 Size: 0 ctime: 0x5230b7ae:55efa068 -- Thu Sep 12 00:04:22 2013 atime: 0x5230b7ae:55efa068 -- Thu Sep 12 00:04:22 2013 mtime: 0x5230b7ae:55efa068 -- Thu Sep 12 00:04:22 2013 crtime: 0x4eeacc8a:0948eb58 -- Fri Dec 16 10:13:54 2011 Size of extra inode fields: 28 Extended attributes stored in inode body: selinux = "system_u:object_r:var_log_t:s000" (31) EXTENTS: (0-24): 35008-35032, (25-54): 164224-164253
Find the entry for crtime in the above output, which is the actual file creation time.
This article has ended here. For more exciting content, you can pay attention to other related column tutorials on the PHP Chinese website! ! !
The above is the detailed content of How to find file creation time (crtime) in Linux. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

To enable PHP containers to support automatic construction, the core lies in configuring the continuous integration (CI) process. 1. Use Dockerfile to define the PHP environment, including basic image, extension installation, dependency management and permission settings; 2. Configure CI/CD tools such as GitLabCI, and define the build, test and deployment stages through the .gitlab-ci.yml file to achieve automatic construction, testing and deployment; 3. Integrate test frameworks such as PHPUnit to ensure that tests are automatically run after code changes; 4. Use automated deployment strategies such as Kubernetes to define deployment configuration through the deployment.yaml file; 5. Optimize Dockerfile and adopt multi-stage construction

Building an independent PHP task container environment can be implemented through Docker. The specific steps are as follows: 1. Install Docker and DockerCompose as the basis; 2. Create an independent directory to store Dockerfile and crontab files; 3. Write Dockerfile to define the PHPCLI environment and install cron and necessary extensions; 4. Write a crontab file to define timing tasks; 5. Write a docker-compose.yml mount script directory and configure environment variables; 6. Start the container and verify the log. Compared with performing timing tasks in web containers, independent containers have the advantages of resource isolation, pure environment, strong stability, and easy expansion. To ensure logging and error capture

Confirm the target hard disk device name (such as /dev/sda) to avoid accidentally deleting the system disk; 2. Use sudoddif=/dev/zeroof=/dev/sdXbs=1Mstatus=progress to overwrite the zero value in full disk, which is suitable for most scenarios; 3. Use sudoshred-v-n3/dev/sdX for three random data overwrites to ensure that it cannot be restored; 4. Optionally execute sudobadblocks-wsv/dev/sdX for destructive write tests; finally use sudohexdump-C/dev/sdX|head to verify whether it is all zero and complete safe erasing.

Windowsisbetterforbeginnersduetoeaseofuse,seamlesshardwarecompatibility,andsupportformainstreamsoftwarelikeMicrosoftOfficeandAdobeapps.2.LinuxoutperformsWindowsonolderorlow-resourcehardwarewithfasterboottimes,lowersystemrequirements,andlessbloat.3.Li

cronisusedforpreciseschedulingonalways-onsystems,whileanacronensuresperiodictasksrunonsystemsthataren'tcontinuouslypowered,suchaslaptops;1.Usecronforexacttiming(e.g.,3AMdaily)viacrontab-ewithsyntaxMINHOURDOMMONDOWCOMMAND;2.Useanacronfordaily,weekly,o

AfterinstallingLinux,thefirststepsincludeupdatingyoursystem,installingessentialsoftware,settingupbackupandsecuritymeasures,andcustomizingtheinterfacetosuityourpreferences.1)Updateyoursystemusingtheappropriatecommandforyourdistro(e.g.,sudoaptupdate&am

There are three main ways to install software on Linux: 1. Use a package manager, such as apt, dnf or pacman, and then execute the install command after updating the source, such as sudoaptininstallcurl; 2. For .deb or .rpm files, use dpkg or rpm commands to install, and repair dependencies when needed; 3. Use snap or flatpak to install applications across platforms, such as sudosnapinstall software name, which is suitable for users who are pursuing version updates. It is recommended to use the system's own package manager for better compatibility and performance.

ChoosePop!_OS,Ubuntu,NobaraLinux,orArchLinuxforoptimalgamingperformancewithminimaloverhead.2.InstallofficialNVIDIAproprietarydriversforNVIDIAGPUs,ensureup-to-dateMesaandkernelversionsforAMDandIntelGPUs.3.EnabletheperformanceCPUgovernor,usealow-latenc
