博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux 多个参数 空格_如何在Linux中减少多个空格?
阅读量:2515 次
发布时间:2019-05-11

本文共 563 字,大约阅读时间需要 1 分钟。

linux 多个参数 空格

How to cut by multiple spaces in ?

如何在减少多个空格?

For example, if I get a like

例如,如果我得到一个像

a b  c      d

where the spaces among the fields are not decided.

字段之间的空间不确定。

How to get the four fields a, b, c and d out?

如何获得四个字段a,b,c和d?

Here, we take getting ‘b’ (the 2nd field) as the example.

在这里,我们以“ b”(第二字段)为例。

You can first squeeze the repeated spaces by and then use as normal:

您可以先通过来压缩重复的空格,然后照常使用 :

tr -s ' ' | cut -d ' ' -f 2

Another way is to use directly:

另一种方法是直接使用 :

awk '{
$2}'
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。

翻译自:

linux 多个参数 空格

转载地址:http://gmowd.baihongyu.com/

你可能感兴趣的文章
python 最大连续子数组的和
查看>>
Python中的闭包
查看>>
05.if else format
查看>>
如何从Eclipse官网下载我们想要的版本
查看>>
js获取spn里面的东西
查看>>
Mongodb之增删改查操作
查看>>
elasticsearch 索引,更新,增量更新,不停机修改升级 ,简单使用
查看>>
前端生成二维码图片以及条形码图片
查看>>
LA4794 分享巧克力
查看>>
《梦断代码》第四阶段阅读感想(包括第9、10、11共三章)
查看>>
OpenCV4Android 之 OpenCV4Android SDK
查看>>
serialVersionUID作用
查看>>
解决无法访问U盘打开提示拒绝访问的问题
查看>>
unicode 字符串。互相准换
查看>>
分组加密算法CBC模式的 Padding Oracle Attack 与 Hash算法的Length Extention Attack 小记...
查看>>
虚拟基类的初始化
查看>>
C++中析构函数为什么要是虚函数
查看>>
【转】记录pytty用户名和密码
查看>>
Django Rest Framework 视图和路由
查看>>
不忘初心,方得始终 ,让我们一起学习成长,感谢有你!
查看>>