- 1、本文档共7页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
linux命令参数esc.,Linux基础命令(⼀).md
⽬录
Linux 系统作业
实验任务:
⼀、了解Bash的特性
1、Bash的特性:
⽀持命令历史、命令补全、路径补全
⽀持管道、重定向
⽀持命令别名
⽀持命令⾏编辑
⽀持命令⾏展开
⽀持⽂件名通配
⽀持变量
⽀持编程
⼆、Bash的常⽤操作技巧及命令演⽰
1、命令历史
在键盘上输⼊history
[root@localhost ~]# history
1 vi /etc/sysconfig/network-scripts/ifcfg-en33
2 vi /etc/sysconfig/network-scripts/ifcfg-ens33
3 ZZ
4 s
5 systemtl restart network
6 ip a
7 cd/root/Docements
8 cd./path
9 ls-a
10 -a
11 ip a
12 history
13 ls
14 mkdir a
15 ls
16 mkdir -p {a{abc,def},b,c}
17 ls a
18 ls
19 history
20 cd
21 cd a
22 cd a/
23 ls
24 cd
25 ls
26 ls a*
27 move a hh
28 mv a hh
29 ls
30 echo $a
31 ench $shell
32 ench $bash
33 ench
34 mkdir a
35 ls
36 mkdir `b`
37 history
[root@localhost ~]#
2、命令补全
命令记不全的时候可以先输⼊⼀部分命令按键盘上的tab键,按⼀下能补全的就是唯⼀命令,按⼀下没反应就按两下,在陈列出来的命令中
找到你要补全的命令
[root@localhost ~]# w
w watch wdctl whereis whiptail wipefs wpa_supplicant
wait watchgnupg weak-modules which who wpa_cli write
wall wc whatis while whoami wpa_passphrase
3、命令别名
[root@localhost ~]# alias cdnet='cd/etc/sysconfig/network-scripts'
[root@localhost ~]# alias
alias cdnet='cd/etc/sysconfig/network-scripts'
alias cp='cp -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
4、命令⾏展开
[root@localhost ~]# mkdir -p a/{b/{e,f},c/{g,h},d/{li}}
5、⽂件名通配
[root@localhost ~]# ls a*
anaconda-ks.cfg
a:
b c d
6、变量
[root@localhost ~]# a=10
[root@localhost ~]# echo $a
10
7、反引号,键盘左上⾓Esc下⾯的键,⽤于命令替换
反引号⾥⾯只能放⼊命令,不然会报错,反引号也可以⽤ $() 替换
[root@localhost ~]# echo `pwd`
/root
[root@localhost ~]# echo `jjyy`
-bash: jjyy: 未找到命令
[root@localhost ~]# echo $(pwd)
/root
8、单引号,强引⽤,不完成变量替换
[root@localhost ~]# echo $a
10
[root@localhost ~]# echo '$a'
$a
9、双引号,弱引⽤,可以实现变量替换
[root@localhost
文档评论(0)