Linux下touch命令的用法
2016-01-12 23:20
489 查看
Touch Command Options
a, change the access time only
-c, if the file does not exist, do not create it
-d, update the access and modification times
-m, change the modification time only
-r, use the access and modification times of file
-t, creates a file using a specified time
1.创建一个新的空文件
2.创建多个文件
3.只修改access time为现在的时间,-a
4.只修改modification time为现在的时间,-m
5.如果文件不存在,避免创建新文件,-c
6.同时精确设定access and modification times,-t
sets the access and modification date and time to a file leena as 17:30 (17:30 p.m.) December 10 of the current year (2012).
7.使用另一个指定文档的access and modifications times设定文件的时间戳,-r
8.创建一个新文件并指定精确的access and modifications times
a, change the access time only
-c, if the file does not exist, do not create it
-d, update the access and modification times
-m, change the modification time only
-r, use the access and modification times of file
-t, creates a file using a specified time
1.创建一个新的空文件
# touch sheena
2.创建多个文件
# touch sheena meena leena
3.只修改access time为现在的时间,-a
# touch -a leena
4.只修改modification time为现在的时间,-m
# touch -m leena
5.如果文件不存在,避免创建新文件,-c
# touch -c leena
6.同时精确设定access and modification times,-t
# touch -c -t YYDDHHMM leena
sets the access and modification date and time to a file leena as 17:30 (17:30 p.m.) December 10 of the current year (2012).
# touch -c -t 12101730 leena
7.使用另一个指定文档的access and modifications times设定文件的时间戳,-r
# touch -r leena meena
8.创建一个新文件并指定精确的access and modifications times
# touch -t YYMMDDHHMM.SS tecmint
# touch -t 201212101830.55 tecmint
相关文章推荐
- 使用secureCRT远程Linux,出现远程主机拒绝连接
- Linux $符号的用法
- Linux xclip命令
- linux 使用别名
- Linux命令行下的vim文本编辑器
- 解决SecureCRT连接linux超时后断开
- Linux之DebugFS(一)-----------------------追踪内核函数调用
- Linux系统精讲(2.6-3.9)
- Linux内核构建系统之八
- Linux中各种终端的解释
- Linux TOP 命令详述
- Linux下各规格的磁盘操作
- linux链接--硬链接,软链接
- Linux进程间通信之管道
- Linux下设置环境变量
- linux获取命令行参数struct option
- Linux笔记整理:设置任务定时删除文件
- 解决CentOS下man 命令,没有帮助信息
- CentOS 7修改主机名【hostnamectl】
- Linux下用SSH免密码登陆其他指定主机