每天学一点儿shell:linux常用快捷键

cat结合grep搜索关键字

[root@hadoop-master test]# cat -n file1.txt |grep "1"
     1	第1行
    10	第10行

find搜索文件内容

下面是搜索当前文件夹下以.txt结尾,并且内容包含“5”的内容

[root@hadoop-master test]# find ./*.txt  -type f | xargs grep "5"
./file1.txt:第5行
./file2.txt:第5行

scp上传下载

上传
上传单个文件到服务器

[root@hadoop-master test]# scp ./uploadScpTest.txt root@hadoop-slave1:/usr/local/test
uploadScpTest.txt  

上传目录到服务器

[root@hadoop-master test]# scp -r ./ root@hadoop-slave1:/usr/local/test
uploadScpTest.txt  

下载
从服务器把文件下载到本地目录

[root@hadoop-master test]# scp root@hadoop-slave1:/usr/local/test/scptest.txt ./
scptest.txt    

把整个目录下载到本地

[root@hadoop-master test]# scp -r root@hadoop-slave1:/usr/local/test ./
file1.txt   

curl发送POST请求

curl -H "Content-Type: application/json" -X POST -d '{"user_id": "123", "coin":100, "success":1, "msg":"OK!" }' "http://192.168.0.1:8001/test"

CURL 发送POST请求

常用快捷键和命令

快捷键

xshell的rz和sz

rz上传文件
rz:received(接收),服务器接收文件,也就是本地上传到服务器。
图片1
sz下载文件
sz:send(发送),服务器发送文件,也就是本地从服务器下载文件。
图2

猜你喜欢

转载自blog.csdn.net/u011047968/article/details/107955109