学习Oracle之前需具备的Linux基

文章来源:角膜穿孔   发布时间:2016-12-12 19:00:16   点击数:
  

今天我们继续学习Linux系统管理,开搞~

查看内存使用状况

[root

localhost~]#free

totalusedfreesharedbufferscached

Mem:

-/+buffers/cache:4

Swap:

当前系统内存总大小为(单位是k)已经使用,剩余。真正剩余的是第二行的,真正使用的也是第二行的,因为系统初始化时,分配出一部分内存给缓存,这部分缓存用来随时提供给程序使用,如果程序不用,那这部分内存就空闲。所以,查看内存使用情况看第二行的数据。

[root

localhost~]#free-m

totalusedfreesharedbufferscached

Mem:

-/+buffers/cache:

Swap:

[root

localhost~]#free-g

totalusedfreesharedbufferscached

Mem:

-/+buffers/cache:01

Swap:

以上是以M和G位单位去查看。

查看系统进程

ps在之前已经讲过了,今天加一些补充内容

[root

localhost~]#psaux

[root

localhost~]#ps-elf

以上两种用法都能查看当前进程的详细信息,差别不大,这里楼主贴出一部分输出结果用作讲解

[root

localhost~]#psaux

USERPID%CPU%MEMVSZRSSTTYSTATSTARTTIMECOMMAND

root10.00.?SsMay:01/sbin/init

root20.00.?SMay:00[kthreadd]

root30.00.?SMay:00[ksoftirqd/0]

root50.00.?SMay:00[kworker/0:0H]

root60.00.?SMay:02[kworker/u:0]

root70.00.?SMay:00[kworker/u:0H]

root80.00.?SMay:00[migration/0]

PID:进程的id,结束进程用kill-9id号

STAT:进程的状态,分为以下几种

D不能中断的进程

R正在运行中的进程

S已经中断的进程,通常情况下,系统中大部分进程都是这个状态

T已经停止或者暂停的进程,如果正在运行一个命令,按一下ctrl+z暂停,ps查看就会显示T

Z僵尸进程,一般不会出现。

高优先级进程

N低优先级进程

s主进程

l多线程进程

+正在前台运行的进程

查看网络状况

[root

localhost~]#netstat-lnp

[root

localhost~]#netstat-an

netstat-lnp:当前系统启动哪些端口

netstat-an:网络连接状况

抓包工具

[root

localhost~]#tcpdump-nn-ieth0

tcpdump:verboseoutputsuppressed,use-vor-vvforfullprotocoldecode

listeningoneth0,link-typeEN10MB(Ethernet),capturesizebytes

19:12:44.ARP,Requestwho-has..1.tell..1.1,length46

19:12:44.619ARP,Requestwho-has..1.tell..1.1,length46

19:12:44.IP..1......:UDP,length

19:12:44.IP..1..60598..1..:UDP,length40

没有tcpdump这个命令,yuminstall-ytcpdump安装。第三列和第四列显示哪一个IP.端口在连接哪一个IP.端口。-i选项后面跟设备名称,-nn选项的作用是让第三列和第四列显示成IP+端口号的形式,如果不加-nn则显示主机名+服务名。

[root

localhost~]#tcpdump-ieth0

tcpdump:verboseoutputsuppressed,use-vor-vvforfullprotocoldecode

listeningoneth0,link-typeEN10MB(Ethernet),capturesizebytes

19:14:49.ARP,Requestwho-has..1.tell..1.1,length46

19:14:49.IP..1..google-public-dns-a.google.







































早期白癜风治好的方法
白癜风治好会复发吗

转载请注明:http://www.iwkqm.com/tjyy/4699.html