How VPS - How to use/setup VPS
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System Linux

DEBUGFS Command – Show File Creation Times in Linux

How VPS by How VPS
November 2, 2018
in Linux, Operating System
0
0
SHARES
121
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Find File Creation Date in Linux

In Unix-like systems such as Linux, everything is considered a file, and all information about a file (metadata or file attributes such as creation time, last modification etc..), except the actual file content are stored in an inode and Linux identifies each and every file by its inode number other than the human readable filename.

In addition, the Linux stat program is a useful utility for displaying file or file system status. It shows information such as inode number, time of file birth, last data modification, last access, last status change and much more. We will combine both programs to find actual file creation time in Linux.

In this article, we will explain how to find one of the critical attributes of a file using the debugfs and stat programs to obtain the following creation/access information for a file in Linux filesystems.

  • ctime: Shows file change time.
  • atime: Shows file access time.
  • mtime: Shows file modification time.
  • crtime: Shows file creation time.

Find File Creation Date in Linux

1. To find a file creation date and time “crtime” is to find the inode of the file using the stat command against a file called “About-TecMint”.

$ stat About-TecMint 

  File: 'About-TecMint'
  Size: 260       	Blocks: 8          IO Block: 4096   regular file
Device: 80ah/2058d	Inode: 14420015    Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/ tecmint)   Gid: ( 1000/ tecmint)
Access: 2017-02-23 14:15:20.263337740 +0530
Modify: 2015-10-22 15:08:25.236299000 +0530
Change: 2016-08-01 10:26:36.603280013 +0530
 Birth: -

Alternatively, you can use the ls -i command against a file called “About-TecMint”.

$ ls -i About-TecMint
 
14420015 About-TecMint

From the output of the above commands, the file inode number is 14420015. Please make a note of this unique inode number as we will be using this inode number in the following steps.

2. Now we need to find the root filesystem that our file resides in, simply issue the following df -h command to identify the root file system.

$ df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            3.9G     0  3.9G   0% /dev
tmpfs           788M  9.7M  779M   2% /run
/dev/sda10      324G  277G   31G  91% /
tmpfs           3.9G  192M  3.7G   5% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/loop3       87M   87M     0 100% /snap/core/4486
/dev/loop0       87M   87M     0 100% /snap/core/4407
/dev/loop1       82M   82M     0 100% /snap/core/4206
/dev/loop2      181M  181M     0 100% /snap/vlc/190
/dev/loop4      189M  189M     0 100% /snap/vlc/158
cgmfs           100K     0  100K   0% /run/cgmanager/fs
tmpfs           788M   40K  788M   1% /run/user/1000

From the above output, the filesystem for the root partition is /dev/sda10 (make a note of this filesystem). This will be different on your system.

3. Next, use the debugfs command to find the creation time of the file called “About-TecMint”, with the -R flag which instructs debugfs to execute the single external command specified with inode number 14420015 (stat in this case) and then exit.

$ sudo debugfs -R 'stat <14420015>' /dev/sda10

Inode: 14420015   Type: regular    Mode:  0777   Flags: 0x80000
Generation: 2130000141    Version: 0x00000000:00000001
User:  1000   Group:  1000   Size: 260
File ACL: 0    Directory ACL: 0
Links: 1   Blockcount: 8
Fragment:  Address: 0    Number: 0    Size: 0
 ctime: 0x579ed684:8fd54a34 -- Mon Aug  1 10:26:36 2016
 atime: 0x58aea120:3ec8dc30 -- Thu Feb 23 14:15:20 2017
 mtime: 0x5628ae91:38568be0 -- Thu Oct 22 15:08:25 2015
crtime: 0x579ed684:8fd54a34 -- Mon Aug  1 10:26:36 2016
Size of extra inode fields: 32
EXTENTS:
(0):57750808
(END)

From the above output it clears that the file “About-TecMint” was created on Mon Aug 1 10:26:36 2016 as provided by crtime. You will also see “ctime“, “atime” and “mtime” of your file.

Source: tecmint.com

Tags: Linux Commandslinux guidelinux vps setup guide
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Install Apache Tomcat 8 on CentOS 7
Linux

How to Install Apache Tomcat 8 on CentOS 7?

February 11, 2020
Install Arch Linux With Btrfs Snapshotting
Uncategorized

Install Arch Linux With Btrfs Snapshotting

February 13, 2020
Next Post

How to Repair and Defragment Linux System Partitions and Directories

6 Useful X-based (Gui Based) Linux Commands – Part II

20 Practical Examples of RPM Commands in Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

Install HTMLDoc on Fedora 29

3 years ago

How to Install Apache Tomcat 8 on CentOS 7

3 years ago

How to Install Microweber on CentOS 7

3 years ago

How to Configure Firewall with UFW on Ubuntu 18.04

4 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8 February 25, 2022
  • How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.