如何使用 sed 仅获取文件名?我有这个
out_file=$(echo $in_file|sed "s/\(.*\.\).*/\1mp4/g")
但我也得到了路径/root/video.mp4,而且我只想要video.mp4.
/root/video.mp4
video.mp4
sed filenames
filenames ×1
sed ×1