创建、删除文件和目录:touch 命令
使用命令 touch
来修改文件时间戳,但是它也能快速创建一个空文件。你也可以通过使用文本编辑器打开文件来创建新文件,比如 nano
:
[ andrew@pc01 ex ]$ ls
[ andrew@pc01 ex ]$ nano a
编辑文件
[ andrew@pc01 ex ]$ ls
a
或仅使用 touch
:
[ andrew@pc01 ex ]$ touch b && ls
a b
技巧:
^ z (Ctrl+z) 命令将当前程序切到后台
[ andrew@pc01 ex ]$ nano a
编辑文件,然后按 ^ z
# 使用 fg 来回到 nano [1]+ Stopped nano a // nano a 已停止 [ andrew@pc01 ex ]$ fg
再次编辑文件
技巧
在运行过程中按 ^ c(Ctrl + c)终止当前(前台)进程
使用
kill %N
终止后台进程,其中N
是jobs
命令显示的工程索引
推荐文章: