---
title: "linux命令-cut/sed"
author: "mingren135"
date: "2013-06-23T15:53:41Z"
tags: []
categories: ["移动开发"]
slug: "linux-cut-sed"
draft: false
lastmod: "2013-06-23T15:53:41Z"
id: 1893022
url: "https://mingren135.iteye.com/blog/1893022"
---

一、cut：从一行上移除部分内容，选择性显示

1）cut -cnum1-num2 filename

```
➜  Downloads  cat example 
helloworld!usa!china!
➜  Downloads  cut -c6-13 example 
world!us
```

 2）cut -d 'sep' -f cnum filename

```
➜  Downloads  cut -d '!' -f 3 example
china
```