5
【笔记】Shell获取文件路径
source link: https://en.loli.fj.cn/2022/11/27/Shell%E8%8E%B7%E5%8F%96%E6%96%87%E4%BB%B6%E8%B7%AF%E5%BE%84/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
【笔记】Shell获取文件路径
2022-11-27
Shell获取文件路径
获取文件名
获取包含后缀的文件名
/a/b.c
:指定文件路径
basename /a/b.c
获取不包含后缀的文件名
.c
:指定后缀名
basename /a/b.c .c
获取不含文件名的路径
dirname /a/b.c
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK