文件相關(guān)
拷貝文件夾及其所有內(nèi)容(遞歸)
# cp -r 文件夾名 目標(biāo)路徑
刪除空文件夾
# rmdir 文件夾名
刪除非空文件夾
# rm -rf 文件夾名
查看隱藏文件
# ls -a
更改文件名
# mv 源文件名 目文件名
批量更改文件名:Rename the specified files by replacing the first occurrence of from in their name by to
# rename from to file...
查看文件類型(Linux并不是靠后綴來決定文件類型的)
# file 文件名
用戶相關(guān)
查看所有用戶 or 所有組
看第三個參數(shù),500以上的,就是后面建的用戶了,其它則為系統(tǒng)用戶。
# cat /etc/passwd?? or ? # cat /etc/group
濾掉系統(tǒng)用戶
# cat /etc/passwd | grep home
刪除用戶 or 組
# userdel 用戶名? or? # groupdel 組名
更改用戶的工作目錄
# usermod -d 目錄路徑 用戶名
更改用戶所屬組,是覆蓋
# usermod -g 組名 用戶名
將用戶添加到某個組,是疊加,作為非默認(rèn)組
# usermod -G 組名 用戶名
?
系統(tǒng)狀態(tài)相關(guān)
查看進程
# ps
進程列表,可以實時刷新的
# top
查看端口使用情況
# netstat
網(wǎng)絡(luò)相關(guān)
重啟網(wǎng)絡(luò)連接
# /sbin/service network restart
關(guān)閉防火墻
# /sbin/service iptables stop
查看網(wǎng)卡地址
# ifconfig
查看網(wǎng)關(guān)
(Genmask=0.0.0.0的那個就是網(wǎng)關(guān))
# netstat -r
查看DNS
(Genmask=0.0.0.0的那個就是網(wǎng)關(guān))
# route -n
其它
查看命令的路徑(比如那些通過PATH而到處都可以運行的命令)
# type 命令名
清屏
# clear
關(guān)機
# /sbin/shutdown -h now
一分鐘以后關(guān)機
# /sbin/shutdown -h +1
posted on 2008-03-25 16:34
Jcat 閱讀(302)
評論(0) 編輯 收藏 所屬分類:
Linux