Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个像这样的文本文件
abcdefg abcdefg abcdefg abcdefg
如何用sed删除每行的第一个和最后两个字符?我想得到这样的输出
bcde bcde bcde bcde
sed 's/^.\(.*\)..$/\1/' file
这可能对您有用:
sed 's/^.\|..$//g' file