实验命令:
文件(Command 文件)
1.touch 新建
2.rm 删除
3.mv 移动或者重命名
4.cp 复制
5.cat 文件输出到屏幕
目录(Command 目录)
1.mkdir 新建
2.rm 删除
3.mv -r 移动或者重命名
4.cp -r 复制
5.cd 切换目录
cd .. 当前目录的父目录
cd - 前一个目录
cd ~ 默认目录
cd / 根目录
6.tree 查看目录树
实验终端结果
```
shiyanlou:// $ pwd [23:28:32]
/
shiyanlou:// $ cd ~ [23:28:46]
shiyanlou:/ $ pwd [23:28:49]
/home/shiyanlou
shiyanlou:/ $ cd /home/shiyanlou/Code [23:28:53]
shiyanlou:Code/ $ ls [23:29:13]
shiyanlou:Code/ $ pwd [23:29:16]
/home/shiyanlou/Code
shiyanlou:Code/ $ cd /home/shiyanlou/Code [23:29:18]
shiyanlou:Code/ $ cd~ [23:30:08]
zsh: command not found: cd~
shiyanlou:Code/ $ cd ~ [23:30:29]
shiyanlou:/ $ ls [23:30:32]
Code game.py lib package.json webpack.config.js
Desktop golang node_modules src-gen yarn.lock
shiyanlou:/ $ mkdir mycode [23:30:35]
shiyanlou:/ $ ls [23:31:13]
Code game.py lib node_modules src-gen yarn.lock
Desktop golang mycode package.json webpack.config.js
shiyanlou:/ $ mkdir -p one/two/three [23:31:22]
shiyanlou:~/ $ tree one [23:31:49]
one
\u2514\u2500\u2500 two
\u2514\u2500\u2500 three
2 directories, 0 files
shiyanlou:/ $ touch hello [23:31:56]
shiyanlou:/ $ ls [23:32:29]
Code golang mycode package.json yarn.lock
Desktop hello node_modules src-gen
game.py lib one webpack.config.js
shiyanlou:/ $ touch hello [23:32:30]
shiyanlou:/ $ ls [23:32:43]
Code golang mycode package.json yarn.lock
Desktop hello node_modules src-gen
game.py lib one webpack.config.js
shiyanlou:/ $ cp hello one/two/ [23:32:45]
shiyanlou:/ $ tree one [23:33:14]
one
\u2514\u2500\u2500 two
\u251c\u2500\u2500 hello
\u2514\u2500\u2500 three
2 directories, 1 file
shiyanlou:/ $ mkdir test [23:33:19]
shiyanlou:/ $ cp -r test one/two [23:33:45]
shiyanlou:~/ $ tree one [23:34:13]
one
\u2514\u2500\u2500 two
\u251c\u2500\u2500 hello
\u251c\u2500\u2500 test
\u2514\u2500\u2500 three
3 directories, 1 file
shiyanlou:/ $ ls [23:34:19]
Code game.py hello mycode one src-gen webpack.config.js
Desktop golang lib node_modules package.json test yarn.lock
shiyanlou:/ $ rm hello [23:34:53]
shiyanlou:/ $ ls [23:35:05]
Code golang node_modules src-gen yarn.lock
Desktop lib one test
game.py mycode package.json webpack.config.js
shiyanlou:/ $ rm -r test [23:35:07]
shiyanlou:/ $ ls [23:35:22]
Code game.py lib node_modules package.json webpack.config.js
Desktop golang mycode one src-gen yarn.lock
shiyanlou:/ $ mv /home/shiyanlou [23:35:23]
mv: \u5728'/home/shiyanlou' \u540e\u7f3a\u5c11\u4e86\u8981\u64cd\u4f5c\u7684\u76ee\u6807\u6587\u4ef6
Try 'mv --help' for more information.
shiyanlou:/ $ cd /home/shiyanlou [23:35:58]
shiyanlou:/ $ touch test1 [23:36:17]
shiyanlou:/ $ mkdir dir1 [23:36:31]
shiyanlou:/ $ ls [23:36:47]
Code game.py mycode package.json webpack.config.js
Desktop golang node_modules src-gen yarn.lock
dir1 lib one test1
shiyanlou:/ $ mv test1 dir1 [23:36:48]
shiyanlou:/ $ ls [23:37:02]
Code game.py mycode package.json yarn.lock
Desktop golang node_modules src-gen
dir1 lib one webpack.config.js
shiyanlou:~/ $ tree dir1 [23:37:04]
dir1
\u2514\u2500\u2500 test1
0 directories, 1 file
shiyanlou:/ $ touch hellp [23:37:12]
shiyanlou:/ $ mv hellp /one/two [23:37:45]
mv: \u65e0\u6cd5\u5c06'hellp' \u79fb\u52a8\u81f3'/one/two': \u6ca1\u6709\u90a3\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55
shiyanlou:~/ $ tree one [23:38:13]
one
\u2514\u2500\u2500 two
\u251c\u2500\u2500 hello
\u251c\u2500\u2500 test
\u2514\u2500\u2500 three
3 directories, 1 file
shiyanlou:/ $ mv hellp one/two [23:38:21]
shiyanlou:/ $ ls [23:38:34]
Code game.py mycode package.json yarn.lock
Desktop golang node_modules src-gen
dir1 lib one webpack.config.js
shiyanlou:~/ $ tree one [23:38:36]
one
\u2514\u2500\u2500 two
\u251c\u2500\u2500 hello
\u251c\u2500\u2500 hellp
\u251c\u2500\u2500 test
\u2514\u2500\u2500 three
3 directories, 2 files
shiyanlou:/ $ ls [23:38:46]
Code game.py mycode package.json yarn.lock
Desktop golang node_modules src-gen
dir1 lib one webpack.config.js
shiyanlou:/ $ touch test1 [23:38:59]
shiyanlou:/ $ mv test1 test2 [23:39:17]
shiyanlou:/ $ ls [23:39:32]
Code game.py mycode package.json webpack.config.js
Desktop golang node_modules src-gen yarn.lock
dir1 lib one test2
shiyanlou:/ $ ls [23:39:34]
Code game.py mycode package.json webpack.config.js
Desktop golang node_modules src-gen yarn.lock
dir1 lib one test2
shiyanlou:/ $ tree dir1 [23:39:48]
dir1
\u2514\u2500\u2500 test1
0 directories, 1 file
shiyanlou:~/ $ cd dir1 [23:40:06]
shiyanlou:dir1/ $ mv test1 test2 [23:40:30]
shiyanlou:dir1/ $ cp /etc/passwd passwd [23:40:44]
shiyanlou:dir1/ $ [23:42:13]
shiyanlou:dir1/ $ ls [23:42:16]
passwd test2
shiyanlou:dir1/ $ man cat [23:43:07]
shiyanlou:dir1/ $ cd ~ [23:45:25]
shiyanlou:/ $ ls [23:45:31]
Code game.py mycode package.json webpack.config.js
Desktop golang node_modules src-gen yarn.lock
dir1 lib one test2
shiyanlou:/ $ cd Desktop [23:45:33]
shiyanlou:Desktop/ $ [23:45:48]
shiyanlou:Desktop/ $ ls [23:45:48]
fcitx.desktop gedit.desktop hello xfce4-terminal.desktop
firefox.desktop gvim.desktop sublime_text.desktop
shiyanlou:Desktop/ $ cat -n hello [23:45:50]
1 hello shiyanlou%