什么是用于删除行的前N个字符一个unix命令? [英] What is a unix command for deleting the first N characters of a line?

查看:107
本文介绍了什么是用于删除行的前N个字符一个unix命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,我可能会想:

tail -f logfile | grep org.springframework | <command to remove first N characters>

我在想, TR 可能做到这一点的能力,但我不知道。

I was thinking that tr might have the ability to do this but I'm not sure.

推荐答案

使用剪切。例如。剥去前4个字符每行(即启动5号字符):

Use cut. Eg. to strip the first 4 characters of each line (i.e. start on the 5th char):

tail -f logfile | grep org.springframework | cut -c 5-

这篇关于什么是用于删除行的前N个字符一个unix命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆