linux常用命令隨記

  1. 建立軟鏈接
ln -s shell執行路徑  軟鏈接路徑
ln -s /root/node/bin/node /usr/bin/node
# 此時node命令時全局的
  1. 寶塔安裝mariadb失敗:使用快速安裝,不要使用編譯安裝
  2. 查看端口情況
# 查看端口
netstat -aptn | grep 3000
# 端口使用的進程
netstat -tnlp | grep :22
# 運行的程序
ps -aux
# 殺死程序
kill %jobnum

4.配置用戶權限

vim /etc/sudoers
  1. 端口
# 查看開放端口
iptables -L -n
# 修改開放端口
vim /etc/sysconfig/iptables
  1. 啓動程序
# 查看apache2文件,裏面有啓動方式
sudo /etc/init.d/apache2 start
  1. python2與python3切換
# 設置python3選項
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
# 查看Python選項
sudo update-alternatives --config python
# 結果如下

在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章