Linux 基本命令,Linux命令
- 壓縮、解壓命令
-
- 壓縮:tar -zcvf appName.tar.gz.date appFileName(例如:tar -zcvf rc.tar.gz.0513 rc)
- 解壓:tar -xvf tarFile
- tar命令詳細說明:
-
- tar 打包壓縮;-c 歸檔檔案,-x 壓縮檔,-z gzip壓縮,-j bzip2壓縮,-v view顯示壓縮或者解壓過程,-f 使用檔名。
-
- tar -cvf rc.tar rc 只打包,不壓縮;
- tar -zcvf rc.tar.gz rc 打包,並用gzip壓縮;(常用)
- tar -jcvf rc.tar.bz2 rc 打包並用bzip2壓縮。
- 解壓,tar -xcvf fileName
- 尋找檔案:
-
- 尋找檔案內容:
- 檔案許可權:
- 分為三種許可權:R 讀 數值表示為4,W 寫 數值表示為2,X 可執行 數值表示為1。
- 命令:chmod
- chmod +x filename 給檔案添加可執行許可權;
- chmod +w fileanme 給檔案添加寫入權限
- 軟串連B>A :
linux安裝服務:
linux如何查看系統版本:
| 磁碟空間以及檔案佔用情況: df -h (human readable) du -h --max-depth=1 /usr 可以查看/usr開始深度為1的目錄的檔案佔用空間大小 |
| |
清空檔案命令: > filename 查看大於100M檔案 find ./ -size +204800查看檔案內容 find ./ -type f -name "*.jsp" | xargs grep "威海" 尋找目前的目錄下,所有的jsp檔案中,包含“威海”的檔案 查看被刪除的檔案,有哪些進程還在訪問:lsof -n | grep deleted 查看掛載的硬碟情況: |
| sudo fdisk -l |
查看本機IP curl ifcpnfig.me 查看輸出檔案: tail -f nohup.out 後台啟動: nohup ./startWeblogic.sh |
| lsof -p [進程ID] 可以查看某一ID進程開啟的檔案狀況。 超級copy: |
scp fromfilePath tofilePath(userName@IP:/filePath) forExample: scp isportal_uum_sj.tar.gz.0928 root@172.16.66.18:/opt/apache-tomcat-6.0.37/webapps |
| |
>setup 查看系統狀態 system servie等; SFTP/ftp協議 防火牆: vi /etc/sysconfig/iptables 放開某一連接埠限制(通過防火牆): -A INPUT -m state --state NEW -m tcp -p tcp --dport 3083(連接埠) -j ACCEPT 基本命令防火牆: service iptables stop/start 設定預設關閉/開啟防火牆: chkconfig iptables off/on時間同步服務: yum install ntp校時命令: ntpdate cn.pool.ntp.org sysctl -w net.ipv4.tcp_tw_recycle=1 安裝gcc yum -y install gcc make gcc-c++ openssl-devel