乱七八糟的各种问题解决(持续更新)
linux中感叹号的转义、感叹号的使用## linux命令执行得到报错: -bash: !xxxx: event not found
如果是要输出文本中的感叹号,可以使用单引号,如 echo ‘hello world !’;
如果是在命令中可以将感叹号转义为!,如curl ***** http://127.0.0.1:8899/xxx/xxx!xxx.ilf
另外,感叹号的用法:
(1)!!:表示上一条命令;
(2)!
:
表
示
上
一
条
命
令
中
最
后
一
个
参
数
,
如
c
d
/
u
s
r
c
d
!
:表示上一条命令中最后一个参数,如cd /usr cd !
:表示上一条命令中最后一个参数,如cd/usrcd! (执行完cd /usr后执行cd !$相当于执行cd /usr);
(3)!str:表示history中最近一条以str开头的命令,如 ipconfig !ipconfig (相当于 ipconfig);
(4)!?str?:表示history中最近一条包含str的命令,如 cd /usr/xxx/abc/efg !?abc?;
(5)!n和!-n:!n表示history中正数第n条命令,!-n表示history中倒数第n条命令。
curl -i -H "Content-Type: appllication/json" -H "token: abcdefg" -X POST -d '{"one": 1}' http://127.0.0.1/test



