In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "linux how to check when the folder was created". In the daily operation, I believe many people have doubts about how to view the folder when it was created by linux. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for you to answer the question of "how to view the folder when it was created by linux". Next, please follow the editor to study!
Methods: 1, use the "stat file path" command to obtain the inode number of the file; 2, use "df-h" to obtain the disk path where the file is located; 3, according to the file inode number and disk path, use the "debugfs-R 'stat' disk path" command to obtain the file creation time.
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
How does linux view the folder when it was created?
I. brief introduction
The creation time of Linux files depends on the file system type. In earlier file systems before ext4 (ext, ext2, ext3), the file's metadata does not record the file creation time, it only records the access time, modification time, and change time (state change time). The basic information for a typical file is as follows:
[root@bugwz ~] # stat test.file File: 'test.file' Size: 2 Blocks: 8 IO Block: 4096 regular fileDevice: 807h/2055d Inode: 5255117 Links: 1Access: (0755/-rwxr-xr-x) Uid: (0 / root) Gid: (0 / root) Access: 2019-12-12 19purl 1133.175841399 + 0800Modify: 2019-12 19purl 1137.564970487 + 0800Change: 2019-12-12 19Fr11Rich 43.079132663 + 0800 Birth:-
Access: access time, last access time of file data (for example, read file contents)
Modify: the modification time, the last modification time of the file data. (for example, modify the contents of a file)
Change: state change time, which is easily confused with Modify time, the change time of file attributes (permissions, size, etc.)
II. Practice
2.1. Get the creation time of the file
Get the file inode number, as shown below, and get the inode number: 5255117
[root@bugwz data] # stat / data/test.file File:'/ data/test.file' Size: 2 Blocks: 8 IO Block: 4096 regular fileDevice: 807h/2055d Inode: 5255117 Links: 1Access: (0755/-rwxr-xr-x) Uid: (0 / root) Gid: (0 / root) Access: 2019-12-12 19Fran 1133.175841399 + 0800Modify: 2019-12-12 19purl Eleven data/test.file File 37.564970487 + 0800Change: 2019-12-12 19Jiang 11purl 43.079132663 + 0800 Birth:-
Find the disk path where the file is located, as shown below, and get the disk path as: / dev/sda7
[root@bugwz data] # df-hFilesystem Size Used Avail Use% Mounted on/dev/sda3 3.9G 2.5G 1.2G 70% / devtmpfs 16G 016G 0% / devtmpfs 16G 0% / dev/shmtmpfs 16G 1.7G 14G 11% / runtmpfs 16G 016G 0% / sys/fs/cgroup/dev/sda1 12G 11G 787M 94% / usr/dev/sda5 7.8G 4.2G 3.2G 57% / tmp/dev/sda7 235G 180G 44G 81% / data/dev/ Sda6 7.8G 2.1G 5.3G 29% / var
Use debugfs to check the creation time of the file, and find that the creation time crtime is: Thu Dec 12 19:05:23 2019
[root@bugwz data1] # debugfs-R 'stat' / dev/sda7debugfs 1.42.9 (28-Dec-2013) Inode: 5255117 Type: regular Mode: 0755 Flags: 0x80000Generation: 758605841 Version: 0x00000000:00000001User: 0 Group: 0 Size: 2File ACL: 0 Directory ACL: 0Links: 1 Blockcount: 8Fragment: Address: 0 Number: 0 Size: 0 ctime: 0x5df2206f:12dddfdc-- Thu Dec 12 19:11:43 2019 atime: 0x5df22065:29ec81dc-Thu Dec 12 19:11:33 2019 mtime: 0x5df22069:86b30fdc-Thu Dec 12 19:11:37 2019crtime: 0x5df21ef3:d586ca44-- Thu Dec 12 19:05:23 2019Size of extra inode fields: 28EXTENTS: (0): 16949121 so far The study on "how to check when the folder was created by linux" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.