rootroot@rootroot-X99-Turbo:~$ ll
-rwxrwxrwx 1 rootroot rootroot 36247187308 5月 23 10:23 Android13.0地面站.tgz*
rootroot@rootroot-X99-Turbo:~$ touch 1Android13.0地面站.tgz
rootroot@rootroot-X99-Turbo:~$ ll
-rwxrwxrwx 1 rootroot rootroot 36247187308 6月 2 09:56 1Android13.0地面站.tgz*
rootroot@rootroot-X99-Turbo:~$ ll
-rwxrwxrwx 1 rootroot rootroot 36247187308 6月 2 09:56 Android13.0地面站.tgz*
20250602在Ubuntu20.04.6下修改压缩包的日期和时间
2025/6/2 14:42
BING:linux 修改 文件 日期和时间 为当前日期和时间
百度:linux 修改 文件 日期和时间
https://chat.deepseek.com/a/chat/s/282d18b1-0f7f-42d2-a4ba-2f5750f7b363
Ubuntu修改文件时间方法总结
ubuntu 修改文件时间和日期 为当前的
在 Ubuntu 中,你可以使用 touch 命令来修改文件的时间戳(包括访问时间和修改时间)为当前时间。以下是具体方法:
1. 将文件的时间戳更新为当前时间
bash
touch 文件名
这会将文件的访问时间(atime)和修改时间(mtime)都更新为当前时间。
2. 仅修改文件的修改时间(mtime)为当前时间
bash
touch -m 文件名
3. 仅修改文件的访问时间(atime)为当前时间
bash
touch -a 文件名
4. 修改为自定义时间(而非当前时间)
如果你想将文件时间设置为指定的时间而不是当前时间,可以使用:
bash
touch -t 202406021830.00 文件名
其中:
202406021830.00 表示 YYYYMMDDhhmm.ss(年月日时分.秒)格式的时间。
5. 递归修改目录及其子目录下的所有文件时间
bash
find 目录名 -exec touch {} \;
这会将该目录及其子目录下的所有文件的时间戳更新为当前时间。
注意事项
你需要有对文件的写入权限才能修改其时间戳。
如果文件不存在,touch 会创建一个新的空文件。
希望这些方法能帮到你!
完整的LOG:
rootroot@rootroot-X99-Turbo:~$ ll
total 35397940
drwxr-xr-x 51 rootroot rootroot 4096 6月 2 09:56 ./
drwxr-xr-x 5 root root 4096 2月 25 09:37 ../
drwxrwxr-x 11 rootroot rootroot 4096 4月 25 17:04 01临时了friendlywrt-h3/
drwxrwxr-x 12 rootroot rootroot 4096 5月 6 11:26 02临时了-单线程编译通过了friendlywrt-h3/
drwxrwxrwx 2 rootroot rootroot 4096 5月 7 11:52 07_源代码/
drwxrwxrwx 3 rootroot rootroot 4096 5月 30 19:07 20241224的神州数码RK3566/
drwxrwxr-x 16 rootroot rootroot 4096 5月 12 11:44 61临时了sd-fuse_h3/
drwxrwxr-x 9 rootroot rootroot 4096 5月 12 17:37 62临时了sd-fuse_h3/
drwxrwxr-x 8 rootroot rootroot 4096 5月 17 16:28 63临时了sd-fuse_h3/
drwxrwxr-x 13 rootroot rootroot 4096 5月 20 09:27 64临时了sd-fuse_h3/
drwxrwxrwx 36 rootroot rootroot 4096 5月 26 15:31 Android13.0/
-rwxrwxrwx 1 rootroot rootroot 36247187308 5月 23 10:23 Android13.0地面站.tgz*
-rw-r--r-- 1 rootroot rootroot 3771 4月 25 10:29 bak1.bashrc
-rw------- 1 rootroot rootroot 28956 5月 30 19:15 .bash_history
-rw-r--r-- 1 rootroot rootroot 220 2月 24 18:43 .bash_logout
-rw-r--r-- 1 rootroot rootroot 3852 4月 25 10:30 .bashrc
drwxrwxr-x 4 rootroot rootroot 4096 5月 13 16:31 BOOT/
drwxr-xr-x 20 rootroot rootroot 4096 5月 30 10:23 .buildroot-ccache/
drwx------ 2 rootroot rootroot 4096 4月 23 13:45 'buildroot linux系统的cpu频率无法查看和修改呢?'/
drwx------ 137 rootroot rootroot 4096 5月 27 11:08 .cache/
drwxr-xr-x 3 rootroot rootroot 4096 4月 25 15:38 .cmake/
drwx------ 20 rootroot rootroot 4096 5月 22 09:13 .config/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Desktop/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Documents/
drwxr-xr-x 2 rootroot rootroot 4096 5月 19 17:18 Downloads/
drwx------ 3 rootroot rootroot 4096 4月 29 20:06 .gnupg/
drwxrwxr-x 2 rootroot rootroot 4096 4月 25 17:00 h3/
drwxrwxr-x 5 rootroot rootroot 4096 6月 2 09:53 hailuo_temp/
drwxr-xr-x 5 rootroot rootroot 4096 3月 7 09:39 .local/
drwx------ 2 rootroot rootroot 4096 4月 25 17:29 LOG/
drwx------ 4 rootroot rootroot 4096 2月 27 17:35 .mozilla/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Music/
drwx------ 3 rootroot rootroot 4096 3月 7 11:04 .nv/
drwxr-xr-x 2 rootroot rootroot 20480 5月 27 17:22 Pictures/
drwx------ 3 rootroot rootroot 4096 3月 12 18:47 .pki/
-rw-r--r-- 1 rootroot rootroot 807 2月 24 18:43 .profile
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Public/
-rw------- 1 rootroot rootroot 7 3月 5 10:32 .python_history
drwxrwxr-x 3 rootroot rootroot 4096 5月 20 14:41 quectel-cm/
drwxrwxr-x 3 rootroot rootroot 4096 5月 6 09:31 r6s/
-rw-r--r-- 1 rootroot rootroot 2 5月 30 18:46 .repo_.gitconfig.json
drwxr-xr-x 35 rootroot rootroot 4096 4月 10 09:23 RK3566_RK3568_Linux5.10_V1.2.0/
drwx------ 19 rootroot rootroot 4096 5月 9 14:44 RK3566的吊舱-IIMG/
drwx------ 2 rootroot rootroot 4096 4月 24 18:36 RK3588+4800w/
drwxrwxr-x 12 rootroot rootroot 4096 5月 21 09:07 sd-fuse_h3/
drwx------ 3 rootroot rootroot 4096 4月 24 17:09 snap/
drwxrwxrwx 16 rootroot rootroot 4096 5月 9 14:43 source/
drwx------ 2 rootroot rootroot 4096 5月 10 16:40 .ssh/
-rw-r--r-- 1 rootroot rootroot 0 2月 25 09:05 .sudo_as_admin_successful
drwxrwxr-x 2 rootroot rootroot 4096 3月 12 18:47 'Sunlogin Files'/
drwxrwxr-x 34 rootroot rootroot 4096 5月 30 18:52 tao_android13/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Templates/
drwx------ 3 rootroot rootroot 4096 6月 2 09:07 tgz/
drwx------ 6 rootroot rootroot 4096 4月 7 12:05 .thunderbird/
drwxrwxr-x 13 rootroot rootroot 4096 5月 30 09:41 version/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Videos/
drwxr-xr-x 2 rootroot rootroot 4096 4月 30 19:06 .vmware/
drwxrwxr-x 4 rootroot rootroot 4096 4月 30 10:27 vmware/
-rw-r--r-- 1 rootroot rootroot 221 5月 20 14:36 .wget-hsts
drwxrwxr-x 8 rootroot rootroot 4096 3月 7 11:53 whisper/
-rw------- 1 rootroot rootroot 256 6月 2 09:56 .Xauthority
drwx------ 2 rootroot rootroot 4096 3月 22 14:59 摄像头/
-rwx------ 1 rootroot rootroot 376 5月 30 16:52 说明.txt*
rootroot@rootroot-X99-Turbo:~$
rootroot@rootroot-X99-Turbo:~$
rootroot@rootroot-X99-Turbo:~$ touch 1Android13.0地面站.tgz
rootroot@rootroot-X99-Turbo:~$ ll
total 35397940
drwxr-xr-x 51 rootroot rootroot 4096 6月 2 09:56 ./
drwxr-xr-x 5 root root 4096 2月 25 09:37 ../
drwxrwxr-x 11 rootroot rootroot 4096 4月 25 17:04 01临时了friendlywrt-h3/
drwxrwxr-x 12 rootroot rootroot 4096 5月 6 11:26 02临时了-单线程编译通过了friendlywrt-h3/
drwxrwxrwx 2 rootroot rootroot 4096 5月 7 11:52 07_源代码/
-rwxrwxrwx 1 rootroot rootroot 36247187308 6月 2 09:56 1Android13.0地面站.tgz*
drwxrwxrwx 3 rootroot rootroot 4096 5月 30 19:07 20241224的神州数码RK3566/
drwxrwxr-x 16 rootroot rootroot 4096 5月 12 11:44 61临时了sd-fuse_h3/
drwxrwxr-x 9 rootroot rootroot 4096 5月 12 17:37 62临时了sd-fuse_h3/
drwxrwxr-x 8 rootroot rootroot 4096 5月 17 16:28 63临时了sd-fuse_h3/
drwxrwxr-x 13 rootroot rootroot 4096 5月 20 09:27 64临时了sd-fuse_h3/
drwxrwxrwx 36 rootroot rootroot 4096 5月 26 15:31 Android13.0/
-rw-r--r-- 1 rootroot rootroot 3771 4月 25 10:29 bak1.bashrc
-rw------- 1 rootroot rootroot 28956 5月 30 19:15 .bash_history
-rw-r--r-- 1 rootroot rootroot 220 2月 24 18:43 .bash_logout
-rw-r--r-- 1 rootroot rootroot 3852 4月 25 10:30 .bashrc
drwxrwxr-x 4 rootroot rootroot 4096 5月 13 16:31 BOOT/
drwxr-xr-x 20 rootroot rootroot 4096 5月 30 10:23 .buildroot-ccache/
drwx------ 2 rootroot rootroot 4096 4月 23 13:45 'buildroot linux系统的cpu频率无法查看和修改呢?'/
drwx------ 137 rootroot rootroot 4096 5月 27 11:08 .cache/
drwxr-xr-x 3 rootroot rootroot 4096 4月 25 15:38 .cmake/
drwx------ 20 rootroot rootroot 4096 5月 22 09:13 .config/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Desktop/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Documents/
drwxr-xr-x 2 rootroot rootroot 4096 5月 19 17:18 Downloads/
drwx------ 3 rootroot rootroot 4096 4月 29 20:06 .gnupg/
drwxrwxr-x 2 rootroot rootroot 4096 4月 25 17:00 h3/
drwxrwxr-x 5 rootroot rootroot 4096 6月 2 09:53 hailuo_temp/
drwxr-xr-x 5 rootroot rootroot 4096 3月 7 09:39 .local/
drwx------ 2 rootroot rootroot 4096 4月 25 17:29 LOG/
drwx------ 4 rootroot rootroot 4096 2月 27 17:35 .mozilla/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Music/
drwx------ 3 rootroot rootroot 4096 3月 7 11:04 .nv/
drwxr-xr-x 2 rootroot rootroot 20480 5月 27 17:22 Pictures/
drwx------ 3 rootroot rootroot 4096 3月 12 18:47 .pki/
-rw-r--r-- 1 rootroot rootroot 807 2月 24 18:43 .profile
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Public/
-rw------- 1 rootroot rootroot 7 3月 5 10:32 .python_history
drwxrwxr-x 3 rootroot rootroot 4096 5月 20 14:41 quectel-cm/
drwxrwxr-x 3 rootroot rootroot 4096 5月 6 09:31 r6s/
-rw-r--r-- 1 rootroot rootroot 2 5月 30 18:46 .repo_.gitconfig.json
drwxr-xr-x 35 rootroot rootroot 4096 4月 10 09:23 RK3566_RK3568_Linux5.10_V1.2.0/
drwx------ 19 rootroot rootroot 4096 5月 9 14:44 RK3566的吊舱-IIMG/
drwx------ 2 rootroot rootroot 4096 4月 24 18:36 RK3588+4800w/
drwxrwxr-x 12 rootroot rootroot 4096 5月 21 09:07 sd-fuse_h3/
drwx------ 3 rootroot rootroot 4096 4月 24 17:09 snap/
drwxrwxrwx 16 rootroot rootroot 4096 5月 9 14:43 source/
drwx------ 2 rootroot rootroot 4096 5月 10 16:40 .ssh/
-rw-r--r-- 1 rootroot rootroot 0 2月 25 09:05 .sudo_as_admin_successful
drwxrwxr-x 2 rootroot rootroot 4096 3月 12 18:47 'Sunlogin Files'/
drwxrwxr-x 34 rootroot rootroot 4096 5月 30 18:52 tao_android13/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Templates/
drwx------ 3 rootroot rootroot 4096 6月 2 09:07 tgz/
drwx------ 6 rootroot rootroot 4096 4月 7 12:05 .thunderbird/
drwxrwxr-x 13 rootroot rootroot 4096 5月 30 09:41 version/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Videos/
drwxr-xr-x 2 rootroot rootroot 4096 4月 30 19:06 .vmware/
drwxrwxr-x 4 rootroot rootroot 4096 4月 30 10:27 vmware/
-rw-r--r-- 1 rootroot rootroot 221 5月 20 14:36 .wget-hsts
drwxrwxr-x 8 rootroot rootroot 4096 3月 7 11:53 whisper/
-rw------- 1 rootroot rootroot 256 6月 2 09:56 .Xauthority
drwx------ 2 rootroot rootroot 4096 3月 22 14:59 摄像头/
-rwx------ 1 rootroot rootroot 376 5月 30 16:52 说明.txt*
rootroot@rootroot-X99-Turbo:~$
rootroot@rootroot-X99-Turbo:~$ ll
total 35397940
drwxr-xr-x 51 rootroot rootroot 4096 6月 2 09:57 ./
drwxr-xr-x 5 root root 4096 2月 25 09:37 ../
drwxrwxr-x 11 rootroot rootroot 4096 4月 25 17:04 01临时了friendlywrt-h3/
drwxrwxr-x 12 rootroot rootroot 4096 5月 6 11:26 02临时了-单线程编译通过了friendlywrt-h3/
drwxrwxrwx 2 rootroot rootroot 4096 5月 7 11:52 07_源代码/
drwxrwxrwx 3 rootroot rootroot 4096 5月 30 19:07 20241224的神州数码RK3566/
drwxrwxr-x 16 rootroot rootroot 4096 5月 12 11:44 61临时了sd-fuse_h3/
drwxrwxr-x 9 rootroot rootroot 4096 5月 12 17:37 62临时了sd-fuse_h3/
drwxrwxr-x 8 rootroot rootroot 4096 5月 17 16:28 63临时了sd-fuse_h3/
drwxrwxr-x 13 rootroot rootroot 4096 5月 20 09:27 64临时了sd-fuse_h3/
drwxrwxrwx 36 rootroot rootroot 4096 5月 26 15:31 Android13.0/
-rwxrwxrwx 1 rootroot rootroot 36247187308 6月 2 09:56 Android13.0地面站.tgz*
-rw-r--r-- 1 rootroot rootroot 3771 4月 25 10:29 bak1.bashrc
-rw------- 1 rootroot rootroot 28956 5月 30 19:15 .bash_history
-rw-r--r-- 1 rootroot rootroot 220 2月 24 18:43 .bash_logout
-rw-r--r-- 1 rootroot rootroot 3852 4月 25 10:30 .bashrc
drwxrwxr-x 4 rootroot rootroot 4096 5月 13 16:31 BOOT/
drwxr-xr-x 20 rootroot rootroot 4096 5月 30 10:23 .buildroot-ccache/
drwx------ 2 rootroot rootroot 4096 4月 23 13:45 'buildroot linux系统的cpu频率无法查看和修改呢?'/
drwx------ 137 rootroot rootroot 4096 5月 27 11:08 .cache/
drwxr-xr-x 3 rootroot rootroot 4096 4月 25 15:38 .cmake/
drwx------ 20 rootroot rootroot 4096 5月 22 09:13 .config/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Desktop/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Documents/
drwxr-xr-x 2 rootroot rootroot 4096 5月 19 17:18 Downloads/
drwx------ 3 rootroot rootroot 4096 4月 29 20:06 .gnupg/
drwxrwxr-x 2 rootroot rootroot 4096 4月 25 17:00 h3/
drwxrwxr-x 5 rootroot rootroot 4096 6月 2 09:53 hailuo_temp/
drwxr-xr-x 5 rootroot rootroot 4096 3月 7 09:39 .local/
drwx------ 2 rootroot rootroot 4096 4月 25 17:29 LOG/
drwx------ 4 rootroot rootroot 4096 2月 27 17:35 .mozilla/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Music/
drwx------ 3 rootroot rootroot 4096 3月 7 11:04 .nv/
drwxr-xr-x 2 rootroot rootroot 20480 5月 27 17:22 Pictures/
drwx------ 3 rootroot rootroot 4096 3月 12 18:47 .pki/
-rw-r--r-- 1 rootroot rootroot 807 2月 24 18:43 .profile
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Public/
-rw------- 1 rootroot rootroot 7 3月 5 10:32 .python_history
drwxrwxr-x 3 rootroot rootroot 4096 5月 20 14:41 quectel-cm/
drwxrwxr-x 3 rootroot rootroot 4096 5月 6 09:31 r6s/
-rw-r--r-- 1 rootroot rootroot 2 5月 30 18:46 .repo_.gitconfig.json
drwxr-xr-x 35 rootroot rootroot 4096 4月 10 09:23 RK3566_RK3568_Linux5.10_V1.2.0/
drwx------ 19 rootroot rootroot 4096 5月 9 14:44 RK3566的吊舱-IIMG/
drwx------ 2 rootroot rootroot 4096 4月 24 18:36 RK3588+4800w/
drwxrwxr-x 12 rootroot rootroot 4096 5月 21 09:07 sd-fuse_h3/
drwx------ 3 rootroot rootroot 4096 4月 24 17:09 snap/
drwxrwxrwx 16 rootroot rootroot 4096 5月 9 14:43 source/
drwx------ 2 rootroot rootroot 4096 5月 10 16:40 .ssh/
-rw-r--r-- 1 rootroot rootroot 0 2月 25 09:05 .sudo_as_admin_successful
drwxrwxr-x 2 rootroot rootroot 4096 3月 12 18:47 'Sunlogin Files'/
drwxrwxr-x 34 rootroot rootroot 4096 5月 30 18:52 tao_android13/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Templates/
drwx------ 3 rootroot rootroot 4096 6月 2 09:07 tgz/
drwx------ 6 rootroot rootroot 4096 4月 7 12:05 .thunderbird/
drwxrwxr-x 13 rootroot rootroot 4096 5月 30 09:41 version/
drwxr-xr-x 2 rootroot rootroot 4096 2月 24 18:55 Videos/
drwxr-xr-x 2 rootroot rootroot 4096 4月 30 19:06 .vmware/
drwxrwxr-x 4 rootroot rootroot 4096 4月 30 10:27 vmware/
-rw-r--r-- 1 rootroot rootroot 221 5月 20 14:36 .wget-hsts
drwxrwxr-x 8 rootroot rootroot 4096 3月 7 11:53 whisper/
-rw------- 1 rootroot rootroot 256 6月 2 09:56 .Xauthority
drwx------ 2 rootroot rootroot 4096 3月 22 14:59 摄像头/
-rwx------ 1 rootroot rootroot 376 5月 30 16:52 说明.txt*
rootroot@rootroot-X99-Turbo:~$