man+命令可以查看该命令的帮助
1 |
man ls |
Ctrl+Shift+加号可以放大终端自体,减小则是Ctrl+减号。
Ctrl+u可以撤销输入的命令
pwd 打印当前目录
1
2 |
root@IdeaPad:~# pwd /root |
cd命令可直接回到用户主目录
1
2
3
4
5
6
7 |
evilxr@IdeaPad:~$ cd / tmp evilxr@IdeaPad: / tmp$ pwd / tmp evilxr@IdeaPad: / tmp$ cd evilxr@IdeaPad:~$ pwd / home / evilxr evilxr@IdeaPad:~$ |
rmdir可以删除空目录
touch可创建文件,rm则可以删除文件
1
2
3
4
5
6
7
8 |
xv9@IdeaPad:~$ touch a.tzt xv9@IdeaPad:~$ ls a.tzt Documents examples.desktop Pictures Templates Desktop Downloads Music Public Videos xv9@IdeaPad:~$ rm a.tzt xv9@IdeaPad:~$ ls Desktop Downloads Music Public Videos Documents examples.desktop Pictures Templates |
一次创建或者删除多个对象:
1
2
3
4
5
6
7
8
9 |
xv9@IdeaPad:/tmp/test$ touch a.txt b.txt c.txt xv9@IdeaPad:/tmp/test$ ls a.txt b.txt c.txt xv9@IdeaPad:/tmp/test$ rm a.txt b.txt c.txt xv9@IdeaPad:/tmp/test$ ls xv9@IdeaPad:/tmp/test$ touch a.txt b.txt c.txt xv9@IdeaPad:/tmp/test$ rm *.txt xv9@IdeaPad:/tmp/test$ ls xv9@IdeaPad:/tmp/test$ |
用mkdir创建多级目录的话,需要加上-p
1
2
3
4
5
6
7
8
9
10
11 |
xv9@IdeaPad:/tmp/test$ mkdir -p a/b/c xv9@IdeaPad:/tmp/test$ ls a xv9@IdeaPad:/tmp/test$ cd a xv9@IdeaPad:/tmp/test/a$ ls b xv9@IdeaPad:/tmp/test/a$ cd b xv9@IdeaPad:/tmp/test/a/b$ ls c xv9@IdeaPad:/tmp/test/a/b$ cd c xv9@IdeaPad:/tmp/test/a/b/c$ ls |
rm 强制删除:
1
2
3 |
xv9@IdeaPad:/tmp/test$ rm -rf a xv9@IdeaPad:/tmp/test$ ls xv9@IdeaPad:/tmp/test$ |
mv可移动并修改目录
cat 可以读出并打印文件内容
还有 head teil more les这四个,不过效果各有不同
tar打包:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 |
xv9@IdeaPad:/tmp$ tar -cvf ab.tar aa.c evilxr.txt aa.c evilxr.txt xv9@IdeaPad:/tmp$ ls aa.c evilxr.txt ibus.log orbit-xv9 aa.c.save GkVFj8EQTl jknKDn_vui ssh-eR7evKkCyTQB ab.tar HxwocPXeXB lost+found unity_support_test.0 xv9@IdeaPad:/tmp$ cat aa.c enter another words hello nice www.evilxr.com write in
Nano c = 12; d = 13; z = c+d; xv9@IdeaPad:/tmp$ cat evilxr.txt 你好,欢迎来到我的博客, 我是彩笔~~~ xv9@IdeaPad:/tmp$ |
1 |
解压包则用该命令<br>xv9@IdeaPad:/tmp$ tar -xvf ab.tar |
1
2
3
4
5 |
查看包内的内容: xv9@IdeaPad:/tmp$ tar -tvf ab.tar -rw-rw-r-- evilxr/evilxr 86 2014-05-28 13:00 aa.c -rw-rw-r-- evilxr/evilxr 53 2014-05-28 12:58 evilxr.txt xv9@IdeaPad:/tmp$ |
1
2 |
解压包中指定文件: xv9@IdeaPad:/tmp$ tar -tvf ab.tar a |
原文地址:http://www.cnblogs.com/evilxr/p/3756677.html