chengfengjie / chengfengjie.github.io

我叫MT
1 stars 0 forks source link

shell 常用命令 #2

Open chengfengjie opened 6 years ago

chengfengjie commented 6 years ago

来源: https://coolshell.cn/articles/8619.html python -m SimpleHTTPServer 一句话实现一个HTTP服务,把当前目录设为HTTP服务目录,可以通过http://localhost:8000访问 这也许是这个星球上最简单的HTTP服务器的实现了。

man ascii 显示ascii码表。 场景:忘记ascii码表的时候还需要google么?尤其在天朝网络如此“顺畅”的情况下,就更麻烦在GWF多应用一次规则了,直接用本地的man ascii吧。

du -s * | sort -n | tail 列出当前目录里最大的10个文件。

open . mac os打开当前工作目录

ssh user@server bash < /path/to/local/script.sh 在远程机器上运行一段脚本。这条命令最大的好处就是不用把脚本拷到远程机器上。

chengfengjie commented 6 years ago

Mac OS 查看端口占用

sudo lsof -i :port # 查看port端口占用
sudo kill -9 pid  # 杀死pid的进程
chengfengjie commented 6 years ago

redis相关

homebrew安装的redis,查看安装的信息命令如下:

brew info redis

非brew安装的

whereis redis