linux_不常用命令

linux_不常用命令
=====================================================
查看系统语言环境
[root@DELL root]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=


查看内存使用量和交换区使用量
[root@DELL root]# free -m
total used free shared buffers cached
Mem: 1977 1964 13 0 8 1687
-/+ buffers/cache: 268 1708
Swap: 4000 267 3732

查看指定目录的大小
[root@DELL /]# du -sh pqx
49M pqx


查看所有分区
[root@DELL /]# fdisk -l

Disk /dev/sda: 293.3 GB, 293391564800 bytes
255 heads, 63 sectors/track, 35669 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13 104391 83 Linux
/dev/sda2 14 1033 8193150 83 Linux
/dev/sda3 1034 2053 8193150 83 Linux
/dev/sda4 2054 35669 270020520 f Win95 Ext'd (LBA)
/dev/sda5 2054 2563 4096543+ 82 Linux swap
/dev/sda6 2564 3073 4096543+ 83 Linux
/dev/sda7 3074 3583 4096543+ 83 Linux
/dev/sda8 3584 3838 2048256 83 Linux
/dev/sda9 3839 3965 1020096 83 Linux
/dev/sda10 3966 35669 254662348+ 83 Linux

Disk /dev/sdb: 299.9 GB, 299976622080 bytes
255 heads, 63 sectors/track, 36470 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Disk /dev/sdb doesn't contain a valid partition table

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 1 38913 312568641 7 HPFS/NTFS

查看所有网络接口的属性
[root@DELL /]# ifconfig
eth1 Link encap:Ethernet HWaddr 00:14:22:76:87:C7
inet addr:192.168.0.3 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:25824659 errors:0 dropped:0 overruns:0 frame.:0
TX packets:36669606 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9411557768 (8975.5 Mb) TX bytes:13330459211 (12712.9 Mb)
Base address:0xccc0 Memory:df6e0000-df700000

eth2 Link encap:Ethernet HWaddr 00:14:22:76:87:C8
inet addr:192.168.0.13 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11344390 errors:0 dropped:0 overruns:0 frame.:0
TX packets:1079 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1138761386 (1086.0 Mb) TX bytes:69056 (67.4 Kb)
Base address:0xbcc0 Memory:df4e0000-df500000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:11649699 errors:0 dropped:0 overruns:0 frame.:0
TX packets:11649699 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:13993397876 (13345.1 Mb) TX bytes:13993397876 (13345.1 Mb)


查看防火墙
[root@DELL /]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

查看路由表
[root@DELL /]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
0.0.0.0 192.168.0.254 0.0.0.0 UG 0 0 0 eth1


查看所有监听端口
[root@DELL /]# netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 5649/rpc.statd
tcp 0 0 127.0.0.1:32769 0.0.0.0:* LISTEN 5788/xinetd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 5629/portmap
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 5993/X
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN 5788/xinetd
tcp 0 0 0.0.0.0:1525 0.0.0.0:* LISTEN 6186/tnslsnr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5772/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 5743/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5817

查看所有已经建立的连接
[root@DELL /]# netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:32768 0.0.0.0:* LISTEN 5649/rpc.statd
tcp 0 0 127.0.0.1:32769 0.0.0.0:* LISTEN 5788/xinetd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 5629/portmap
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 5993/X
tcp 0 0 0.0.0.0:113 0.0.0.0:* LISTEN 5788/xinetd
tcp 0 0 0.0.0.0:1525 0.0.0.0:* LISTEN 6186/tnslsnr
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5772/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 5743/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 5817/sendmail: acce
tcp 0 0 192.168.0.3:1525 192.168.0.3:32798 ESTABLISHED 6186/tnslsnr
tcp 0 0 192.168.0.3:1525 192.168.0.21:1325 ESTABLISHED 24155/oraclemis
tcp 0 0 192.168.0.3:1525 192.168.0.77:1323 ESTABLISHED 24109/oraclemis
tcp 0 0 192.168.0.3:1525 192.168.0.77:1320 ESTABLISHED 24101/oraclemis
tcp 0 0 192.168.0.3:1525 192.168.0.21:1402 ESTABLISHED 24298/oraclemis

查看默认网关
[root@DELL /]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
192.168.0.0 * 255.255.255.0 U 0 0 0 eth2
169.254.0.0 * 255.255.0.0 U 0 0 0 eth2
default 192.168.0.254 0.0.0.0 UG 0 0 0 eth1

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25136010/viewspace-682993/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25136010/viewspace-682993/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值