Print text after last slash

时间:2019-05-31 11:56:31

标签: linux bash

I have a Data => File1.txt

Data

@demo/file/wk/Fil0.fk
@demo/file/wk/Fil1.fk
@demo/file/wk/Fil2.fk
@demo/file/wk/Fil3.fk
@demo/file/wk/Fil4.fk

Want to Print the data to Another File2.txt in below Format

Fil0.fk
Fil1.fk
Fil2.fk
Fil3.fk
Fil4.fk

1 个答案:

答案 0 :(得分:0)

尝试以下代码:

cat File1.txt | cut -d'/' -f 4 > File2.txt