常用指令 - 工作雜記

工作雜記

My working blogger,In my daily work log, I meticulously record all the matters and processes I encounter during the day. From the task planning that begins in the morning and the discussions and collaborations with colleagues, to the tools, methods, and processes used in the actual execution of the work, I organize and write them down one by one. Problems encountered during the process, the directions of thought, and the solutions finally found are also clearly recorded in writing

工作雜記

搜尋此網誌

標籤

2016年11月17日 星期四

常用指令



useradd username -s /sbin/nologin
passwd
vi /etc/aliases
postalias hash:/etc/aliases
xfs_quota -x -c "limit -u bsoft=900M bhard=1G username" /home
xfs_quota -x -c "report -ubih" /home

服務相關:
Cent 7:
systemctl XXXXX restart
開機時自動開啟
systemctl enable XXXXX
開機時不要自動開啟
systemctl disable XXXXX
查看所有已啟動的服務
systemctl list-units --type=service

fedora:
service XXXXX restart
chkconfig XXXXX on

網卡設定:
/etc/sysconfig/network-scripts

.tgz

壓縮:tar -czvf filename.tgz XXX (z: gz  j:bz2)

解壓縮:tar -xzvf filename.tgz (z: gz  j:bz2)

.zip
壓縮:zip FileName.zip DirName
解壓:unzip FileName.zip

.rar
壓縮:rar e FileName.rar
解壓:rar a FileName.rar

找尋:
whereis 檔名
find / -name 檔名

即時監控使用中連線
watch -d -n0 "netstat -atnp | grep ESTA"

列出使用中的網路連線
netstat -atnp | grep ESTA


RPM 安裝
rpm -ivh xxx

RPM 查詢
rpm -qa
rpm -ql xxx (查相關檔案)

rpm -qa | grep XXXX
yum list installed
yum list installed | grep XXXX

RPM 移除

rpm -qa | grep xxx (查關聯)
rpm -e xxx

查Process ID並殺掉
ps aux | grep '程序名稱'
kill -9 ID

列port
netstat -tulpn

查iptables
iptables -L -n

查目錄大小
du -shc 目錄

查掛載使用量
df -h

查網路狀態
netstat -nat

停用 username
passwd -l username

啟用 username
passwd -u username


沒有留言:

張貼留言

Post Top Ad

Your Ad Spot