防火牆
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
sudo systemctl status firewalld ##檢視防火牆狀態,是否是running
sudo lsof -i:
9090 #檢視占用的埠號
netstat -an | grep 9090 #檢視埠號:
yum install lsof #安裝lsof
啟動gitlab服務
sudo gitlab-ctl start
sudo gitlab-ctl stop gitlab服務停止
sudo gitlab-ctl restart 重啟gitlab服務
gitlab-rake gitlab:check sanitize
=true
--trace # 檢查gitlab;
sudo gitlab-ctl status # 檢視服務狀態;
sudo gitlab-ctl reconfigure # 啟動服務;
配置gitlab
sudo vim /etc/gitlab/gitlab.rb #開啟配置檔案
# 禁止 gitlab 開機自啟動:
1 systemctl disable gitlab-runsvdir.service
# 啟用 gitlab 開機自啟動:
1 systemctl enable gitlab-runsvdir.service
程序和記憶體
殺掉程序
kill -
950400 # -
9表示強制,50400表示這個id
top 檢視實時情況
df-h 查硬碟佔用率和容量
ps aux 檢視記憶體
free -m 檢視記憶體使用
echo 1
>
/proc/sys/vm/drop_caches 清理記憶體
dmidecode |grep -
a16"memory device$" 檢視記憶體條數
強制刪除正在執行的程式/安裝檔案
rm -rf /
var/run/yum.pid
檢視cup
檢視核心數:
# 檢視物理cpu個數
cat /proc/cpuinfo| grep "physical id"
| sort| uniq| wc -l
# 檢視每個物理cpu
中core的個數
(即核數)
cat /proc/cpuinfo| grep "cpu cores"
| uniq
# 檢視邏輯cpu的個數
cat /proc/cpuinfo| grep "processor"
| wc -l
關機
shutdown -h 10 #計算機將於10分鐘後關閉,且會顯示在登入使用者的當前螢幕中
shutdown -h now #計算機會立刻關機
shutdown -h 22
:22 #計算機會在這個時刻關機
shutdown -r now #計算機會立刻重啟
shutdown -r +
10 #計算機會將於10分鐘後重啟
reboot #重啟
halt #關機
進入root許可權拷貝檔案
sudo su
cd bakcups
gitlab常用命令
進入本地倉庫訪問位置之後執行命令 1 遠端倉庫相關命令 檢出倉庫 gitclonegit git 檢視遠端倉庫 gitremote v 新增遠端倉庫 gitremote add name url 刪除遠端倉庫 gitremote rm name 修改遠端倉庫 gitremote set url pu...
linux 伺服器 常用命令
一.檔案處理命令 1.命令格式與目錄處理命令 ls a 檢視隱藏檔案 ls l 檢視檔案首席資訊官格式顯示 ls d 檢視指定目錄的詳細資訊 ls i 檢視任何檔案的l節點 ll 檔名 檢視乙個檔案的詳細資訊 df 顯示磁碟情況 df lh 詳細磁碟使用情況 df a 全部檔案系統使用情況 df i...
centos伺服器 常用命令
登入 ssh root p yyyy 上傳本地的秘鑰到伺服器 ssh copy id root p yyyy 檢視防火牆 firewall cmd list ports 複製 lsof i tcp 8080 command 程序的名稱 pid 程序識別符號 user 程序所有者 fd 檔案描述符,應...