获取全路径文件名的文件名/文件位置/文件的后缀名/文件的前缀

在shell编程中,对于path file name,咱们可能须要从该字符串中提取出文件所在路径/文件名/文件后缀名/文件前缀,方法实现以下所示:shell $ pfName=/home/user/test.txt # 获取全路径文件名 $ echo $pfName /home/user/test.txt # 获取文件名 $ echo ${pfName#
相关文章
相关标签/搜索