Case_16 touch vim mv cp命令的补充

touch命令除了创建文件外,还可以修改文件时间戳

[root@localhost Desktop]# touch file1 file2 file3
[root@localhost Desktop]# ll
total 4
drwxr-xr-x. 2 root root 4096 Mar 31 20:27 20220401之前
drwxr-xr-x. 2 root root   36 Apr  5 20:28 20220406
-rw-r--r--. 1 root root    0 Apr  5 20:29 file1
-rw-r--r--. 1 root root    0 Apr  5 20:29 file2
-rw-r--r--. 1 root root    0 Apr  5 20:29 file3
[root@localhost Desktop]# touch -t '200007280728' file1 file2
[root@localhost Desktop]# ll
total 4
drwxr-xr-x. 2 root root 4096 Mar 31 20:27 20220401之前
drwxr-xr-x. 2 root root   36 Apr  5 20:28 20220406
-rw-r--r--. 1 root root    0 Jul 28  2000 file1
-rw-r--r--. 1 root root    0 Jul 28  2000 file2
-rw-r--r--. 1 root root    0 Apr  5 20:29 file3
[root@localhost Desktop]# touch file4
[root@localhost Desktop]# touch -t '196912312359' file4
[root@localhost Desktop]# ll
total 4
drwxr-xr-x. 2 root root 4096 Mar 31 20:27 20220401之前
drwxr-xr-x. 2 root root   36 Apr  5 20:28 20220406
-rw-r--r--. 1 root root    0 Jul 28  2000 file1
-rw-r--r--. 1 root root    0 Jul 28  2000 file2
-rw-r--r--. 1 root root    0 Apr  5 20:29 file3
-rw-r--r--. 1 root root    0 Dec 31  1969 file4

touch -r file1 file4 是指将file4的时间和file1同步

[root@localhost Desktop]# touch -r file1 file4
[root@localhost Desktop]# ll
total 4
drwxr-xr-x. 2 root root 4096 Mar 31 20:27 20220401之前
drwxr-xr-x. 2 root root   36 Apr  5 20:28 20220406
-rw-r--r--. 1 root root    0 Jul 28  2000 file1
-rw-r--r--. 1 root root    0 Jul 28  2000 file2
-rw-r--r--. 1 root root    0 Apr  5 20:29 file3
-rw-r--r--. 1 root root    0 Jul 28  2000 file4

当使用vim左右模式打开两个文件时,该如何切换

【:tabn】【:tabp】【:n】【:N】

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述在这里插入图片描述

当异常关闭vim时,会出现“xxx.swp”的隐藏文件保存修改的内容

在异常关闭的基础上再次异常关闭vim,会出现新的隐藏文件“xxx.swo”来保存新的修改内容

在这里插入图片描述

移动mv和复制cp的含义不同

移动后文件的节点号不会变化;而复制后的文件节点号会改变

在这里插入图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值