---
title: "linux 命令收集"
author: "echohfut"
date: "2012-03-22T21:55:20Z"
tags: []
categories: ["操作系统"]
slug: "linux"
draft: false
lastmod: "2012-06-17T15:31:24Z"
id: 1461960
url: "https://echohfut.iteye.com/blog/1461960"
---

1. 不显示/etc/services #开头的行, /etc/services文件并没有修改
sed -e '/^#/d' /etc/services | more 		

2. 忽略前十行，显示后面的内容
sed -e '1,10d' /etc/services | more

3. 打印所有包括BEGIN的行和END行之间的行的内容
sed -n -e '/BEGIN/,/END/p' /my/test/file | more


4. SAR
pidstat -p 3132 2 5 
//每隔2秒，显示5次，PID为３１３２的进程的CPU使用情况显示
pidstat -p 3132 2 5 -r
//每隔2秒，显示5次，PID为３１３２的进程的内存使用情况显示