Linux common commands -96: basename

The basename command is mainly used to display the file name with the file path name excluding the directory part.

Syntax format: basename [parameter]

Common parameters:

Example

 basename /etc/nginx/sites-enabled/default

 basename /etc/nginx/nginx.conf

 # 显示文件名,不显示后缀basename /etc/nginx/nginx.conf .conf

This article is reprinted from https://xugaoxiang.com/2022/09/06/linux-cmds-96-basename/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment