Jump to content

basename

This is a fully translated article. Click here for more information.
From DawoumWiki, the free Mathematics self-learning

basename
Initial releaseJanuary 1979; 45 years ago (1979-01)
Operating systemUnix, Unix-like, Plan 9, Inferno
PlatformCross-platform
TypeCommand
Licensecoreutils: 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

  1. ^ basename – Commands & Utilities Reference, The Single UNIX Specification, Issue 7 from The Open Group
  2. ^ basename(1) – FreeBSD General Commands Manual
  3. ^ basename(1) – Linux User Commands Manual
  4. ^ CoreUtils for Windows
  5. ^ Native Win32 ports of some GNU utilities

External links