basename
Initial release | January 1979 |
---|---|
Operating system | Unix, Unix-like, Plan 9, Inferno |
Platform | Cross-platform |
Type | Command |
License | coreutils: GPLv3+ |
basename은 유닉스와 유닉스-계열 운영 시스템에서 표준 컴퓨터 프로그램입니다. basename은 경로이름이 주어졌을 때, 마지막 슬래시 ('/'
) 문자까지의 임의의 접두사를 삭제하고 결과를 반환할 것입니다. basename은 단일 유닉스 사양에 설명되어 있고 주로 쉘 스크립트에서 사용됩니다.
History
basename
은 1987년 X/Open 이식성 안내서 2호에 소개되었습니다. 그것은 POSIX의 첫 번째 버전과 단일 유닉스 사양으로 상속되었습니다.[1] 그것은 4.4BSD에서 처음 등장했습니다.[2]
GNU coreutils에 번들된 basename
버전은 David MacKenzie에 의해 작성되었습니다.[3]
그 명령은 GnuWin32 프로젝트의 일부로 Microsoft Windows에 대해 별도 패키지로 사용할 수 있고[4] 공통적인 GNU 유닉스-계열 유틸리티의 네이티브 Win32 포트에 대한 UnxUtils 모음입니다.[5]
Usage
basename에 대한 단일 유닉스 사양은 다음과 같습니다:
basename string [suffix]
- string
- A pathname
- suffix
- If specified, basename will also delete the suffix.
Examples
basename
은 임의의 후행하는 슬래시를 무시하는 경로이름에서 성을 검색합니다:
$ basename /home/jsmith/base.wiki
base.wiki
$ basename /home/jsmith/
jsmith
$ basename /
/
basename
은 기본 이름의 끝을 제거할 수도 있지만, 전체 기본 이름은 제거할 수 없습니다:
$ basename /home/jsmith/base.wiki .wiki
base
$ basename /home/jsmith/base.wiki ki
base.wi
$ basename /home/jsmith/base.wiki base.wiki
base.wiki
See also
References
- ^ The Single UNIX Specification, Issue 7 from The Open Group – Commands & Utilities Reference,
- ^ FreeBSD General Commands Manual –
- ^ Linux User Commands Manual –
- ^ CoreUtils for Windows
- ^ Native Win32 ports of some GNU utilities
External links
![](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Wikibooks-logo-en-noslogan.svg/40px-Wikibooks-logo-en-noslogan.svg.png)
The Wikibook Guide to Unix has a page on the topic of: Commands
- The Single UNIX Specification, Issue 7 from The Open Group : return non-directory portion of a pathname – Commands & Utilities Reference,
- Plan 9 Programmer's Manual, Volume 1 –
- Inferno General commands Manual –
- Linux User Commands Manual –
- OpenBSD General Commands Manual –