1. 首页 > Linux教程 > 正文

Linux教程FG054-touch命令(文件创建/时间戳修改)

本文档风哥主要介绍Linux系统中touch命令的使用方法,包括文件创建、时间戳修改、批量操作等,结合RHEL LINUX
10系统环境,提供详细的命令示例和输出结果,适合Linux运维人员在学习和生产环境中使用。更多视频教程www.fgedu.net.cn

参考Red Hat Enterprise Linux 10官方文档中的System administration章节

Part01-基础概念与理论知识

1.1 touch命令的基本概念

touch命令是Linux系统中用于创建空文件和修改文件时间戳的命令。touch命令可以创建不存在的文件,也可以修改已存在文件的访问时间(atime)和修改时间(mtime)。touch命令是Linux系统中最常用的文件管理命令之一,常用于创建空文件、更新文件时间戳等场景。

touch命令的特点:

  • 可以创建空文件
  • 可以修改文件时间戳
  • 可以同时操作多个文件
  • 不会修改文件内容
  • 可以指定任意时间戳

1.2 touch命令的语法格式

touch命令的基本语法格式如下:

# touch命令基本语法
touch [选项] 文件名…

# 语法说明:
# 文件名:要创建或修改时间戳的文件名
# 可以同时指定多个文件名
# 如果文件不存在,则创建空文件
# 如果文件存在,则更新时间戳

1.3 touch命令的常用参数

touch命令的常用参数如下:

# touch命令常用参数

# -a, –time=atime
# 只修改访问时间
touch -a file.txt

# -c, –no-create
# 不创建新文件
touch -c file.txt

# -d, –date=STRING
# 使用指定日期时间
touch -d “2026-01-01 12:00:00” file.txt

# -m, –time=mtime
# 只修改修改时间
touch -m file.txt

# -r, –reference=FILE
# 使用参考文件的时间戳
touch -r reference.txt target.txt

# -t STAMP
# 使用指定时间戳([[CC]YY]MMDDhhmm[.ss])
touch -t 202601011200.00 file.txt

# -h, –no-dereference
# 修改符号链接本身的时间戳
touch -h symlink

# –time=WORD
# 指定时间类型:atime, access, use, mtime, modify
touch –time=atime file.txt

Part02-生产环境规划与建议

2.1 touch命令使用场景规划

在生产环境中,touch命令主要用于以下场景:

# touch命令使用场景规划

# 1. 文件创建场景
# – 创建配置文件
# – 创建日志文件
# – 创建标记文件
# – 创建临时文件

# 2. 时间戳修改场景
# – 更新文件时间戳
# – 同步文件时间戳
# – 文件备份标记
# – 构建系统触发

# 3. 批量操作场景
# – 批量创建文件
# – 批量更新时间戳
# – 批量同步时间戳

# 4. 脚本应用场景
# – 创建锁文件
# – 创建标记文件
# – 触发文件监控
# – 条件判断依据

2.2 touch命令安全使用建议

在生产环境中使用touch命令时,需要注意以下安全建议:

touch命令安全使用建议:

  • 避免覆盖重要文件的时间戳
  • 使用-c参数避免误创建文件
  • 批量操作前先测试
  • 注意文件权限和所有权
  • 避免在关键系统目录创建文件
  • 使用绝对路径避免误操作

2.3 touch命令最佳实践

touch命令在生产环境中的最佳实践: 学习交流加群风哥微信: itpux-com

# touch命令最佳实践

# 1. 创建文件前检查是否存在
# ls file.txt 2>/dev/null || touch file.txt

# 2. 使用参考文件同步时间戳
# touch -r template.conf new.conf

# 3. 批量创建带日期的文件
# touch backup_$(date +%Y%m%d).tar

# 4. 创建锁文件
# touch /var/lock/script.lock

# 5. 更新文件时间戳触发构建
# touch Makefile

# 6. 创建标记文件
# touch /tmp/.backup_completed

Part03-生产环境项目实施方案

3.1 文件创建操作

文件创建是touch命令最常见的用法,以下是在RHEL LINUX 10系统中的实际操作示例:

# 文件创建操作示例

# 1. 创建单个空文件
# touch newfile.txt
# ls -l newfile.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 newfile.txt

# 2. 创建多个文件
# touch file1.txt file2.txt file3.txt
# ls -l file*.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file1.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file2.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file3.txt

# 3. 使用通配符创建文件
# touch log{1..5}.txt
# ls -l log*.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 log1.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 log2.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 log3.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 log4.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 log5.txt

# 4. 创建带路径的文件
# mkdir -p /tmp/testdir
# touch /tmp/testdir/config.conf
# ls -l /tmp/testdir/config.conf
-rw-r–r–. 1 root root 0 Apr 2 10:00 /tmp/testdir/config.conf

# 5. 创建隐藏文件
# touch .hidden_file
# ls -la .hidden_file
-rw-r–r–. 1 root root 0 Apr 2 10:00 .hidden_file

# 6. 不创建已存在的文件(-c参数)
# touch -c existing.txt
# 如果existing.txt不存在,不会创建

# 7. 创建文件并指定权限
# touch newfile.txt
# chmod 755 newfile.txt
# ls -l newfile.txt
-rwxr-xr-x. 1 root root 0 Apr 2 10:00 newfile.txt

# 8. 创建文件并查看详细信息
# touch testfile.txt
# stat testfile.txt
File: testfile.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-04-02 10:00:00.000000000 +0800
Modify: 2026-04-02 10:00:00.000000000 +0800
Change: 2026-04-02 10:00:00.000000000 +0800
Birth: 2026-04-02 10:00:00.000000000 +0800

3.2 时间戳修改操作

时间戳修改是touch命令的核心功能,以下是在RHEL LINUX 10系统中的实际操作示例: from LinuxDBA视频:www.itpux.com

# 时间戳修改操作示例

# 1. 更新文件时间戳为当前时间
# ls -l testfile.txt
-rw-r–r–. 1 root root 0 Apr 2 09:00 testfile.txt

# touch testfile.txt
# ls -l testfile.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 testfile.txt

# 2. 只修改访问时间(atime)
# touch -a testfile.txt
# stat testfile.txt
File: testfile.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-04-02 10:30:00.000000000 +0800
Modify: 2026-04-02 10:00:00.000000000 +0800
Change: 2026-04-02 10:30:00.000000000 +0800
Birth: 2026-04-02 10:00:00.000000000 +0800

# 3. 只修改修改时间(mtime)
# touch -m testfile.txt
# stat testfile.txt
File: testfile.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-04-02 10:30:00.000000000 +0800
Modify: 2026-04-02 11:00:00.000000000 +0800
Change: 2026-04-02 11:00:00.000000000 +0800
Birth: 2026-04-02 10:00:00.000000000 +0800

# 4. 使用指定日期时间
# touch -d “2026-01-01 12:00:00” testfile.txt
# stat testfile.txt
File: testfile.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-01-01 12:00:00.000000000 +0800
Modify: 2026-01-01 12:00:00.000000000 +0800
Change: 2026-04-02 11:30:00.000000000 +0800
Birth: 2026-04-02 10:00:00.000000000 +0800

# 5. 使用时间戳格式
# touch -t 202602151430.00 testfile.txt
# stat testfile.txt
File: testfile.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-02-15 14:30:00.000000000 +0800
Modify: 2026-02-15 14:30:00.000000000 +0800
Change: 2026-04-02 11:35:00.000000000 +0800
Birth: 2026-04-02 10:00:00.000000000 +0800

# 6. 使用参考文件的时间戳
# touch -r /etc/passwd testfile.txt
# stat testfile.txt
File: testfile.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-03-15 08:00:00.000000000 +0800
Modify: 2026-03-15 08:00:00.000000000 +0800
Change: 2026-04-02 11:40:00.000000000 +0800
Birth: 2026-04-02 10:00:00.000000000 +0800

# 7. 修改符号链接的时间戳
# touch -h symlink
# ls -l symlink
lrwxrwxrwx. 1 root root 10 Apr 2 11:45 symlink -> target.txt

# 8. 使用相对时间
# touch -d “yesterday” testfile.txt
# touch -d “tomorrow” testfile.txt
# touch -d “next week” testfile.txt
# touch -d “last month” testfile.txt

3.3 批量操作实战

批量操作在RHEL LINUX 10系统中的实际示例: 学习交流加群风哥QQ113257174

# 批量操作示例

# 1. 批量创建文件
# touch file{1..10}.txt
# ls -l file*.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file1.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file10.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file2.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file3.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file4.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file5.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file6.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file7.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file8.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file9.txt

# 2. 批量创建带日期的文件
# touch backup_$(date +%Y%m%d).tar
# ls -l backup_*.tar
-rw-r–r–. 1 root root 0 Apr 2 10:00 backup_20260402.tar

# 3. 批量更新时间戳
# touch *.txt
# ls -l *.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file1.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file2.txt
-rw-r–r–. 1 root root 0 Apr 2 10:00 file3.txt

# 4. 批量创建目录结构
# mkdir -p /tmp/project/{bin,conf,data,logs}
# touch /tmp/project/conf/{main.conf,db.conf,app.conf}
# ls -l /tmp/project/conf/
total 0
-rw-r–r–. 1 root root 0 Apr 2 10:00 app.conf
-rw-r–r–. 1 root root 0 Apr 2 10:00 db.conf
-rw-r–r–. 1 root root 0 Apr 2 10:00 main.conf

# 5. 批量创建日志文件
# for i in {1..7}; do touch /var/log/app_$(date -d “$i days ago” +%Y%m%d).log; done
# ls -l /var/log/app_*.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260326.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260327.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260328.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260329.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260330.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260331.log
-rw-r–r–. 1 root root 0 Apr 2 10:00 /var/log/app_20260401.log

# 6. 批量同步时间戳
# find /tmp/project -type f -exec touch -r /tmp/project/conf/main.conf {} \;

# 7. 批量创建测试文件
# for i in {1..100}; do touch testfile_$i.txt; done
# ls testfile_*.txt | wc -l
100

# 8. 批量创建并设置时间戳
# for i in {1..5}; do touch -t 20260${i}011200.00 month_$i.log; done
# ls -l month_*.log
-rw-r–r–. 1 root root 0 Jan 1 2026 month_1.log
-rw-r–r–. 1 root root 0 Feb 1 2026 month_2.log
-rw-r–r–. 1 root root 0 Mar 1 2026 month_3.log
-rw-r–r–. 1 root root 0 Apr 1 2026 month_4.log
-rw-r–r–. 1 root root 0 May 1 2026 month_5.log

Part04-生产案例与实战讲解

4.1 touch命令高级用法

touch命令的高级用法和技巧:

# touch命令高级用法

# 1. 创建文件并设置特定时间戳
# touch -t 202601011200.00 newyear_file.txt
# stat newyear_file.txt
File: newyear_file.txt
Size: 0 Blocks: 0 IO Block: 4096 regular empty file
Device: fd00h/64768d Inode: 1234567 Links: 1
Access: (0644/-rw-r–r–) Uid: ( 0/ root) Gid: ( 0/ root)
Context: unconfined_u:object_r:default_t:s0
Access: 2026-01-01 12:00:00.000000000 +0800
Modify: 2026-01-01 12:00:00.000000000 +0800
Change: 2026-04-02 12:00:00.000000000 +0800
Birth: 2026-04-02 12:00:00.000000000 +0800

# 2. 使用touch命令创建锁文件
# touch /var/lock/myscript.lock
# ls -l /var/lock/myscript.lock
-rw-r–r–. 1 root root 0 Apr 2 12:00 /var/lock/myscript.lock

# 检查锁文件是否存在
# if [ -f /var/lock/myscript.lock ]; then
echo “脚本正在运行”
exit 1
fi

# 3. 使用touch命令触发make重新编译
# touch source.c
# make
gcc -c source.c -o source.o
gcc source.o -o program

# 4. 使用touch命令创建标记文件
# touch /tmp/.backup_completed
# touch /tmp/.sync_finished

# 检查标记文件
# if [ -f /tmp/.backup_completed ]; then
echo “备份已完成”
fi

# 5. 使用touch命令修改文件时间戳为未来时间
# touch -d “2027-12-31 23:59:59” future_file.txt
# ls -l future_file.txt
-rw-r–r–. 1 root root 0 Dec 31 2027 future_file.txt

# 6. 使用touch命令修改文件时间戳为过去时间
# touch -d “2020-01-01 00:00:00” old_file.txt
# ls -l old_file.txt
-rw-r–r–. 1 root root 0 Jan 1 2020 old_file.txt

# 7. 使用touch命令创建空目录结构
# mkdir -p /tmp/app/{bin,conf,data,logs,temp}
# touch /tmp/app/bin/.keep
# touch /tmp/app/conf/.keep
# touch /tmp/app/data/.keep
# touch /tmp/app/logs/.keep
# touch /tmp/app/temp/.keep

# 8. 使用touch命令同步多个文件的时间戳
# touch -r template.txt file1.txt file2.txt file3.txt
# stat template.txt file1.txt file2.txt file3.txt | grep Modify
Modify: 2026-04-02 12:00:00.000000000 +0800
Modify: 2026-04-02 12:00:00.000000000 +0800
Modify: 2026-04-02 12:00:00.000000000 +0800
Modify: 2026-04-02 12:00:00.000000000 +0800

4.2 touch命令与脚本结合

touch命令在Shell脚本中的应用:

# touch命令与脚本结合

# 1. 创建备份脚本中的标记文件
# cat > /usr/local/bin/backup.sh << 'EOF' #!/bin/bash BACKUP_DIR="/backup" DATE=$(date +%Y%m%d) LOCK_FILE="/var/lock/backup.lock" MARKER_FILE="/backup/.backup_completed_$DATE" # 检查锁文件 if [ -f "$LOCK_FILE" ]; then echo "备份正在进行中" exit 1 fi # 创建锁文件 touch "$LOCK_FILE" # 执行备份 tar -czf "$BACKUP_DIR/backup_$DATE.tar.gz" /data # 创建标记文件 touch "$MARKER_FILE" # 删除锁文件 rm -f "$LOCK_FILE" echo "备份完成" EOF # chmod +x /usr/local/bin/backup.sh # 2. 使用touch命令创建临时文件 # cat> /tmp/test_script.sh
<< 'EOF' #!/bin/bash TEMP_FILE=$(mktemp) touch "$TEMP_FILE" echo "临时文件: $TEMP_FILE" # 使用临时文件 echo "test data"> “$TEMP_FILE”
cat “$TEMP_FILE”
# 清理临时文件
rm -f “$TEMP_FILE”
EOF

# 3. 使用touch命令实现文件过期检查
# cat > /usr/local/bin/check_expired.sh << 'EOF' #!/bin/bash FILE=$1 DAYS=$2 if [ ! -f "$FILE" ]; then echo "文件不存在" exit 1 fi # 获取文件修改时间 FILE_TIME=$(stat -c %Y "$FILE" ) CURRENT_TIME=$(date +%s) DIFF_DAYS=$(( ($CURRENT_TIME - $FILE_TIME) / 86400 )) if [ $DIFF_DAYS -gt $DAYS ]; then echo "文件已过期 ($DIFF_DAYS 天)" exit 1 else echo "文件未过期 ($DIFF_DAYS 天)" fi EOF # chmod +x /usr/local/bin/check_expired.sh # 4. 使用touch命令创建日志轮转 # cat> /usr/local/bin/log_rotate.sh
<< 'EOF' #!/bin/bash LOG_FILE="/var/log/app.log" MAX_SIZE=10485760 # 10MB if [ -f "$LOG_FILE" ]; then FILE_SIZE=$(stat -c %s "$LOG_FILE" ) if [ $FILE_SIZE -gt $MAX_SIZE ]; then mv "$LOG_FILE" "$LOG_FILE.$(date +%Y%m%d_%H%M%S)" touch "$LOG_FILE" echo "日志已轮转" fi fi EOF # chmod +x /usr/local/bin/log_rotate.sh

4.3 touch命令常见问题处理

touch命令在使用过程中可能遇到的问题及解决方案: 更多学习教程公众号风哥教程itpux_com

# touch命令常见问题处理

# 1. 权限不足问题
# touch /root/file.txt
touch: cannot touch ‘/root/file.txt’: Permission denied

# 解决方案:使用sudo
# sudo touch /root/file.txt

# 2. 目录不存在
# touch /nonexistent/path/file.txt
touch: cannot touch ‘/nonexistent/path/file.txt’: No such file or directory

# 解决方案:先创建目录
# mkdir -p /nonexistent/path
# touch /nonexistent/path/file.txt

# 3. 文件名包含特殊字符
# touch “file with spaces.txt”
# touch ‘file with $pecial.txt’
# touch file\ with\ spaces.txt

# 4. 磁盘空间不足
# touch largefile
touch: cannot touch ‘largefile’: No space left on device

# 解决方案:清理磁盘空间
# df -h
# du -sh /var/log/*

# 5. 文件系统只读
# touch /ro_mount/file.txt
touch: cannot touch ‘/ro_mount/file.txt’: Read-only file system

# 解决方案:重新挂载为读写模式
# mount -o remount,rw /ro_mount

# 6. SELinux上下文问题
# touch /var/www/html/test.html
# ls -lZ /var/www/html/test.html
-rw-r–r–. 1 root root unconfined_u:object_r:httpd_sys_content_t:s0 0 Apr 2 12:00
/var/www/html/test.html

# 7. 符号链接问题
# ln -s /nonexistent/target link_file
# touch link_file
touch: cannot touch ‘link_file’: No such file or directory

# 解决方案:创建目标文件或使用-h参数
# touch -h link_file

# 8. 时间戳格式错误
# touch -t 202613011200.00 file.txt
touch: invalid date format ‘202613011200.00’

# 解决方案:使用正确的时间格式(月份01-12)
# touch -t 202601011200.00 file.txt

Part05-风哥经验总结与分享

5.1 touch命令使用技巧总结

根据多年的Linux运维经验,总结touch命令的使用技巧:

风哥提示:touch命令虽然简单,但在生产环境中使用时一定要注意文件权限和时间戳的影响。特别是在使用touch命令触发构建系统或文件监控时,要确保时间戳的准确性。建议在脚本中使用touch命令创建锁文件和标记文件,以便进行流程控制。

# touch命令使用技巧总结

# 1. 安全创建文件模式
# 创建一个安全的touch别名
alias touch=’touch -c’

# 2. 使用touch命令创建空目录结构
# mkdir -p /app/{bin,conf,data,logs}
# touch /app/{bin,conf,data,logs}/.keep

# 3. 使用touch命令同步文件时间戳
# find /data -type f -exec touch -r /data/template.txt {} \;

# 4. 使用touch命令创建日期标记文件
# touch /backup/.backup_$(date +%Y%m%d)

# 5. 使用touch命令实现简单锁机制
# LOCK_FILE=”/var/lock/myscript.lock”
# if ! mkdir “$LOCK_FILE” 2>/dev/null; then
echo “脚本正在运行”
exit 1
fi
# trap ‘rmdir “$LOCK_FILE”‘ EXIT

# 6. 使用touch命令触发文件监控
# touch /tmp/.trigger_reload

# 7. 使用touch命令创建文件并设置权限
# install -m 644 /dev/null /etc/app/config.conf

# 8. 使用touch命令批量创建测试文件
# for i in {1..100}; do
touch “testfile_$(printf %03d $i).txt”
done

5.2 touch命令操作检查清单

在生产环境中使用touch命令时的检查清单:

touch命令操作检查清单:

  • 确认对目标目录有写权限
  • 确认磁盘空间充足
  • 确认文件名不包含特殊字符
  • 确认时间戳格式正确
  • 确认参考文件存在(使用-r参数时)
  • 确认目标路径存在
  • 确认不会覆盖重要文件
  • 确认SELinux上下文正确
  • 确认文件系统不是只读
  • 确认符号链接有效

5.3 touch命令相关工具推荐

与touch命令相关的工具和替代方案:

# touch命令相关工具推荐

# 1. stat – 查看文件状态信息
# stat file.txt
# 优点:可以查看详细的时间戳信息

# 2. install – 安装文件并设置属性
# install -m 644 -o root -g root /dev/null file.txt
# 优点:可以同时设置权限和所有者

# 3. truncate – 缩小或扩展文件大小
# truncate -s 0 file.txt
# 优点:可以创建指定大小的文件

# 4. mktemp – 创建临时文件
# mktemp /tmp/tempfile.XXXXXX
# 优点:可以创建唯一的临时文件

# 5. file – 查看文件类型
# file file.txt
# 优点:可以查看文件的详细信息

# 6. utmpdump – 转储utmp文件
# utmpdump /var/run/utmp
# 优点:可以查看登录记录

# 7. getfattr – 查看文件扩展属性
# getfattr -d file.txt
# 优点:可以查看文件的扩展属性

# 8. setfattr – 设置文件扩展属性
# setfattr -n user.comment -v “test” file.txt
# 优点:可以设置文件的扩展属性

风哥总结:touch命令是Linux系统中最基础也是最实用的文件管理命令之一。在生产环境中,touch命令常用于创建空文件、更新时间戳、创建锁文件和标记文件等场景。建议熟练掌握touch命令的各种参数和用法,特别是在Shell脚本中的应用。记住,touch命令不会修改文件内容,只会修改文件的时间戳,这一点在文件备份和同步场景中非常重要!更多视频教程www.fgedu.net.cn

本文由风哥教程整理发布,仅用于学习测试使用,转载注明出处:http://www.fgedu.net.cn/10327.html

联系我们

在线咨询:点击这里给我发消息

微信号:itpux-com

工作日:9:30-18:30,节假日休息