Linux指令列的基礎知識:
Linux終端下的基本:
在Linux桌面環境中,滑鼠右鍵選擇“新建終端”,即可打開終端指令列進行下面的操作。(注意,Linux是區分大小寫的)。
切換到管理員: | su – |
添加帳戶: | adduser username |
更改密碼: | passwd username |
載入光碟: | mount /dev/cdrom |
清除防火牆規則: | iptables –F |
查看埠: | netstat –antp |
查看進程: | ps –c | grep ProcessName |
查看系統消息: | more /var/log/messages | grep named |
安裝包: | 查詢已安裝的包 rpm -q ApplicationName |
安裝包 rpm –ivh ApplicationName | |
卸載包 rpm -e ApplicationName –nodeps | |
啟動/重啟/停止服務: | 啟動服務/etc/init.d/ServiceName start |
或者 /sbin/service ServiceName start | |
重啟,關閉 :restart ,stop | |
編輯檔案: | 查看:vi Filename |
修改模式: 按 i | |
指令模式:按Ctrl + C 或 按Esc | |
查找關鍵字:/keyword | |
保存並退出:按esc然後 :wq | |
創建目錄: | mkdir foldername |
創建備份: | mv file1 file2 |
複製檔案: | cp file1 file2 |
更改許可權: | chmod 777 file |
查找指令: | 查找本目錄下檔:find keyword |
全域查找:locate keyword | |
查找指令:where is keyword |