In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly shows you what the Linux system to view file modification time commands are, the content is easy to understand, clear, hope to help you solve your doubts, the following let Xiaobian take you to study and learn the "Linux system view file modification time commands which are" this article.
Use the stat command stat command to display the detailed information of the file attributes, such as the time when the file was last accessed and modified, the file size and other information. It is easy to use. You only need to add the file name after the command:
[root@localhost ~] # stat hello_script.sh File: 'hello_script.sh' Size: 31 Blocks: 8 IO Block: 4096 regular file Device: fd00h/64768d Inode: 67169379 Links: 1 Access: (0755/-rwxr-xr-x) Uid: (0 / root) Gid: (0 / root) Context: unconfined_u:object_r:admin_home_t:s0 Access: 2020-10- 15 19 13 Modify 24.628009932 + 0800 Birth: 2020-10-15 19V 07V 18.266426499 + 0800 Birth: 2020-10-15 19V 11v 48.227856412-
From the output above, we can see the access date of the file, the modification date of the file, the modification date of the file permissions, and other parameters.
If you only want to see the modification date of the file, without considering all other information, run the following command:
[root@localhost] # stat-c% y hello_script.sh 2020-10-15 19 hello_script.sh 07Vol 18.266426499 + 0800
The-c option is used to specify a custom format instead of the default output, while the'% y' flag shows when it was last modified. For folders, the syntax remains the same. Simply replace the file name with the folder name.
The use of the date command date command is to display the current date. However, when used with the-r option, you can display the last modification date of the file, as follows:
[root@localhost] # date-r hello_script.sh Thu Oct 15 19:07:18 CST 2020
Using the ls-l command ls-l command is typically used to use a long list to display other information about the file, such as file permissions and owners, size, and creation date. You can add the-t option so that it can be arranged according to the modification time of the file:
[root@localhost] # ls-lt or [root@localhost ~] # ll-t total 288drwxr-xr-x. 2 root root 177 Oct 16 14:36 b drwxr-xr-x. 2 root root 177Oct 16 14:36 a-rwxr-xr-x. 1 root root 119 Oct 15 19:20 backup_script.sh-rwxr-xr-x. 1 root root 31 Oct 15 19:07 hello_script.sh-rw-r--r--. 1 root root 227 Oct 13 16:39 content.txt-rw-r--r--. 1 root root 277159 Oct 12 14:37 a.txt drwxr-xr-x. 2 root root 195 Aug 6 14:12 Files-rw-. 1 root root 1284 Dec 29 2019 anaconda-ks.cfg
Another way to use the httpie tool to check the modification date of a file is to use httpie, which is a HTTP command line client tool. This tool is typically used to interact with HTTP servers and API, and to check the modification time of files that reside on web servers.
You first need to make sure that python's pip package management tools are installed, and then install the httpie tools:
In Centos7/RHEL7, run the following command to install httpie:
[root@localhost ~] # yum-y install python-pip [root@localhost ~] # pip install-- upgrade pip [root@localhost ~] # pip install httpie run the following command in Ubuntu / Deepin / Debian to install httpie:
After the $sudo apt install httpie installation is complete, how can I check the modification time of the files on the web server? The syntax is as follows:
Http-h [url] | grep 'Last-Modified' for example, from the www.linuxprobe.com website, view the modification time of a picture in .png format:
[root@localhost ~] # http-h https://www.linuxprobe.com/wp-content/uploads/2020/06/6-1.png | grep-I 'Last-Modified' Last-Modified: Fri, 05 Jun 2020 14:26:11 GMT
What are the versions of Linux? the versions of Linux are Deepin, UbuntuKylin, Manjaro, LinuxMint, Ubuntu and so on. Among them, Deepin is one of the best-developed Linux distributions in China; UbuntuKylin is a derivative release based on Ubuntu; Manjaro is a Linux release based on Arch; LinuxMint's default Cinnamon desktop is similar to Windows XP's easy-to-use; Ubuntu is the Linux operating system based on desktop applications.
The above is about "what are the commands for Linux system to view file modification time". If this article is helpful to you and think it is well written, please share it with your friends to learn new knowledge. if you want to know more about it, please pay more attention to the industry information channel.
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.