Linux Command Summary basename

Source: Internet
Author: User
Tags syslog

1. Function description

BaseName

Prints "name" after removing the leading directory path part from the file name path.

If you specify a suffix, the trailing "suffix" is also removed.


2. Usage

basename path name [suffix]

basename options


3. Options

--HELP Display this help message and exit

--version display version information and exit


4. Example

Default only removes path print file name and suffix

#basename/root/install.log.syslog

Install.log.syslog


Specifying a suffix (. syslog) removes the specified suffix from printing

# Basename/root/install.log.syslog. syslog

Install.log


In fact, we can see the result, the part of the specified file name will remove the specified part of the print file name.

# Basename/root/install.log.syslog. Log.syslog

Install

Basename/root/install.log.syslog Stall.log.syslog

Inch


This article from "Gen Y Little Rookie" blog, declined reprint!

Linux Command Summary basename

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.