Linux基础命令:常用的几个命令 linux常用命令

一、磁盘管理命令 1.df
查看文件系统信息.
使用模式:
df ‐hdf ‐B unit # k m g t P ... 2.du
查看文件的大小.
使用模式:
【Linux基础命令:常用的几个命令 linux常用命令】df ‐s ‐B unit # k m g t P ... 二、网络管理命令 1.ping
测试两台主机之间的网络连通性.
使用模式:
ping IP # IP地址#ping 192.168.28.1ping domain # 域名#ping www.baidu.com# ctrl + c 中断命令 2.ifconfig
查看网络设备信息.
使用模式:
ifconfig #所有设备ifconfig equip_name #特定设备 3.netstat
查看网络程序打开的端口信息.
使用模式:
netstat ‐anp #查看所有端口netstat ‐anp | grep 'keyword' #根据关键字查找端口 [root@localhost ~]# netstat ‐anpActive Internet connections (servers and established)Proto Recv‐Q Send‐Q Local Address Foreign Address StatePID/Program nametcp 0 0 127.0.0.1:2208 0.0.0.0:* LISTEN3732/hpiodtcp 0 0 0.0.0.0:750 0.0.0.0:* LISTEN3536/rpc.statdtcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN3504/portmaptcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN3759/cupsdtcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN3868/sendmail: accetcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN3737/pythontcp 0 0 :::22 :::* LISTEN3750/sshdtcp 0 148 ::ffff:192.168.28.130:22 ::ffff:192.168.28.1:57520 ESTABLISHED5327/1#关键字Local Address: 本机IP,网络程序端口Foreign Address:远程主机IP,网络程序端口PID:本机网络程序进程标识符Program name: 本机网络程序名 三、 备份压缩命令 压缩格式:

windows: *.rar *.zip *.7Z
linux: *.zip *.gz *.bz2
1.zip
使用模式:
zip ‐r xxx.zip files 2.unzip
使用模式:
unzip xxx.zip上传下载:rz #上传文件sz filename #下载文件 3.tar
打包或压缩文件.
● 打包: 将多个文件合并成一个文件. *.tar
● 压缩: 减少文件容量. gzip *.tar.gz ; bzip2 *.tar.bz2
使用模式:
tar ‐cvf xxx.tar files #打包文件tar ‐tvf xxx.tar #查看包中有哪些文件tar ‐xvf xxx.tar #解包tar ‐xvf xxx.tar ‐C dst_dir #指定解包路径tar ‐czvf xxx.tar.gz files #用gzip压缩tar ‐cjvf xxx.tar.bz2 files #用bzip2压缩tar ‐xzvf xxx.tar.gz #用gzip解压tar ‐xjvf xxx.tar.bz2 #用bzip2解压# c create# v view# f file# x 解压,解包# z gzip# j bzip2 四、 程序安装命令 安装方式:
源码安装(项目2)
rpm安装
windows: *.exe
redhat: *.rpm (redhat package manage)
安装步骤:
▲ s1.查看包是否安装
rpm ‐qa | grep 'keyword' ▲ s2.卸载包
rpm ‐e keyword# earse ▲ s3.安装包
rpm ‐ivh *.rpm # *.rpm包名-- 展开阅读全文 --

    推荐阅读