各种工具的简易操作记录

2022-07-07 loading

# 一、npm

## 添加用户
npm adduser
## 登录
npm login --registry https://registry.npmjs.org
npm login --scope=@xxxx.ee --registry http://registry.npmjs.org

## 发布
npm publish --registry https://registry.npmjs.org  

npm unpublish vuepress-blog-yaya  --registry https://registry.npmjs.org --force

# 二、Nginx

## 安装
sudo yum install -y nginx 
## 启动
sudo systemctl enable nginx
sudo systemctl start nginx
## 状态查看
sudo systemctl status nginx

##在CentOS 8上管理您的NGINX服务器;为了管理您的NGINX服务器,您有多种选择。
## 要检查NGINX的状态,您必须运行以下命令
$ sudo systemctl status nginx
## 要停止您的NGINX服务器,请运行
$ sudo systemctl stop nginx
## 如果要重新启动,则必须运行
$ sudo systemctl start nginx
## 如果您对NGINX服务器进行了一些修改,则可以重新加载它而不必停止并重新启动它。
## 要重新加载NGINX,您只需运行
$ sudo systemctl reload nginx
## 如果您不想在引导时启动NGINX服务器,则必须通过运行来禁用它
$ sudo systemctl disable nginx
## 重启
nginx -s reload

# 三、docker

docker image ls
docker image prune
## 显示中间层镜像
docker image ls -a
docker image rm [选项] <镜像1> [<镜像2> ...]
## 这条命令会用 nginx 镜像启动一个容器,命名为 webserver,并且映射了 80 端口,这样我们可以用浏览器去访问这个 nginx 服务器。
docker run --name webserver -d -p 80:80 nginx
# 现在,假设我们非常不喜欢这个欢迎页面,我们希望改成欢迎 Docker 的文字,我们可以使用 docker exec 命令进入容器,修改其内容。
docker exec -it webserver bash

docker container ls 
docker container stop id 
docker container rm id 
# 强制删除
docker container rm -f id 
# 以查看所有已经创建的包括终止状态的容器 
docker container ls -a
# 如果数量太多要一个个删除可能会很麻烦,用下面的命令可以清理掉所有处于终止状态的容器
docker container prune

# 四、MongoDB

# 五、服务器

# 查看Centos内存使用情况linux命令
cat /proc/meminfo 
free -h
ps aux --sort -rss
top
# (查看磁盘使用情况)
df -h 
支付宝打赏
支付宝打赏
微信打赏
微信打赏