Computer Hope

Other Pages

Home
Site map
Computer help

Dictionary
News
Q&A
What's new

Tools

E-mail this page
Print Preview
Edit this page



 

Linux / Unix basename command

Quick links

About basename
Syntax
Examples
Related commands
Unix main page

About basename

The basename utility deletes any prefix ending in / and the suffix (if present in string) from string, and prints the
result on the standard output. It is normally used inside substitution marks (``) within shell procedures.

Syntax

basename [string] [suffix]

string The leading part of the path name or string.
suffix Additional remaining portion of name that if matches will be removed.

Examples

basename myfile.txt .txt - Takes the basename of myfile.txt and strips the .txt portion and then just displays myfile. 

Related commands

expr

 

Index

Category:
Linux / Unix

Companies:
Click here

Related Pages:

 

Resolved

Were you able to locate the answer to your questions?

Home - Computer help - Contact - Dictionary - Links
Link to Computer Hope - Bookmark Computer Hope