我在.bashrc中添加了一个别名
alias sr ='sudo /etc/rc.d/[parameter?] restart'
sr network - > sudo /etc/rc.d/network restart
sr sshd - > sudo /etc/rc.d/sshd restart
可以实现,谢谢!
我在 macosx 上使用 TextEdit 创建了两个文件,相同的内容具有不同的编码,然后
grep xxx filename_UTF-16
Run Code Online (Sandbox Code Playgroud)
没有
grep xxx filename_UTF-8
Run Code Online (Sandbox Code Playgroud)
xxxxxxx xxxxxxyyyyyy
grep did not support UTF-16?
Run Code Online (Sandbox Code Playgroud) UTF-8文件test.txt:
AAAAAAAAAAAAAA
Run Code Online (Sandbox Code Playgroud)
十六进制是
41 41 41 41 41 41 41 41 41 41
Run Code Online (Sandbox Code Playgroud)
sed s/A/B/g test.txt 作品
sed s/\x41/B/g test.txt 不起作用
有些字符是不可打印的,所以我必须使用它们的十六进制,A这只是一个例子.