PHPer需要用的shell常用命令(收藏)

前言
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
https://xueqiu.com/1938759729...
使用Linux shell是一些程序员每天的基本工作,但我们经常会忘记一些有用的shell命令和技巧。当然,命令我能记住,但我不敢说能记得如何用它执行某个特定任务。需要注意一点的是,有些用法需要在你的Linux系统里安装额外的软件。下面话不多说了,来看看详细的内容吧。

检查远程端口是否对bash开放:

`echo >/dev/tcp/8.8.8.8/53 && echo "open"` 

*   1

让进程转入后台:

`Ctrl + z` 

*   1

产生随机的十六进制数,其中n是字符数:

`openssl rand -hex n` 

*   1

在当前shell里执行一个文件里的命令:

`source /home/user/file.name` 

*   1

截取前5个字符:

`${variable:0:5}` 

*   1

SSH debug 模式:

`ssh -vvv user@ip_address` 

*   1

SSH with pem key:

`ssh user@ip_address -i key.pem` 

*   1

用wget抓取完整的网站目录结构,存放到本地目录中:

`wget -r --no-parent --reject "index.html*" http://hostname/ -P /home/user/dirs` 

*   1

一次创建多个目录:

`mkdir -p /home/user/{test,test1,test2}` 

*   1

列出包括子进程的进程树:

`ps axwef` 

*   1

创建 war 文件:

`jar -cvf name.war file` 

*   1

测试硬盘写入速度:

`dd if=/dev/zero of=/tmp/output.img bs=8k count=256k; rm -rf /tmp/output.img` 

*   1

测试硬盘读取速度:

`hdparm -Tt /dev/sda` 

*   1

获取文本的md5 hash:

`echo -n "text" | md5sum` 

*   1

用”=”打印出横线:全选复制放进笔记

你可能感兴趣的:(php)