假设我有一个文件/from/here/to/there.txt,并且只想获取其dirname的最后一部分to而不是/from/here/to,我该怎么办?
/from/here/to/there.txt
to
/from/here/to
bash shell dirname
更新:数据是每行一个句子,单词用空格分隔,这个结构应该保留.我用python和一个单词计数器完成了它,只是想知道它是否可以用更智能的方式完成命令行.
linux bash shell
bash ×2
shell ×2
dirname ×1
linux ×1