使用cut或awk操纵目录?

Err*_*404 0 linux bash awk command-line command

我在Linux中处理一些目录,我试图操纵文件名,这是我的情况

grep 'string' | awk '{print $2$3}' 
Run Code Online (Sandbox Code Playgroud)

我得到以下内容

dir1/another-directory/even-another-directory/file1.jpeg
dir1/another-directory/even-another-directory/fiiile2.jpeg
dir1/another-directory/even-another-directory/filee4.jpeg
dir1/another-directory/even-another-directory/fileee1.jpeg
Run Code Online (Sandbox Code Playgroud)

我试图采取这些文件的最后一部分(斜杠之后的任何内容),以便我得到这样的列表,在CSV文件中可能吗?

file1.jpeg
fiiile2.jpeg
filee4.jpeg
fileee1.jpeg
Run Code Online (Sandbox Code Playgroud)

是awk还是削减才能做到这一点?我知道这是一个非常基本的问题,但到目前为止我找不到相关的在线内容.

谢谢,

Ken*_*ent 5

用awk做所有事情:

awk '/string/{x=$2$3;sub(/.*\//,"",x);print x}'
Run Code Online (Sandbox Code Playgroud)