diff --git a/command/cut.md b/command/cut.md index 40674dea51..4112fb824e 100644 --- a/command/cut.md +++ b/command/cut.md @@ -157,4 +157,17 @@ efghijklmnopqrstuvwxyz efghijklmnopqrstuvwxyz ``` +打印最后5个字符: + +遗憾的是, `cut`并没有提供最后字符的支持. 不过我们可以通过字符串反转来实现. + +```shell +[root@localhost text]# cat test.txt| rev | cut -c -5 | rev +vwxyz +vwxyz +vwxyz +vwxyz +vwxyz +``` +