Course overview and the shell
# Course overview + the shell
date
echo hello
echo "Hello world"
echo $PATH
which echo
pwd(present working directory)
cd /home
cd .
cd ..
cd ~
cd -
ls
ls ..
ls --help
ls -l
# 权限控制
r--read
w--write
x--execute
# 移动/重命名
mv dotefiles.md foo.md
cp dotfiles.md foo.md
rm ../food.md
mkdir photos
rmdir photos
man ls
ctrl+L
# input streams
# output streams
echo hello > hello.txt
cat hello.txt
cat < hello.txt
cat < hello.txt > hello2.txt
cat < hello.txt >> hello2.txt
ls -l / | tail n1
curl --head --silent google.com | grep -i content-length | cut --delimiter=' ' -f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
shell 通过环境变量来找程序
# 参考资料
https://missing.csail.mit.edu/
https://missing-semester-cn.github.io/
https://www.bilibili.com/video/BV14E411J7n2
https://www.youtube.com/watch?v=&list=PLyzOVJj3bHQuloKGG59rS43e29ro7I57J
https://missing-semester-cn.github.io/2020/course-shell/
上次更新: 2021/08/17, 18:07:06
- 02
- README 美化05-20
- 03
- 常见 Tricks 代码片段05-12