Programming Tutorials

(追記) (追記ここまで)

basename in Mac OS X

By: Strauss K in macos Tutorials on 2011年02月03日 [フレーム]

basename is a command in Mac OS X and other Unix-based systems that is used to strip the directory path and return only the base filename. It takes a file path as an argument and returns the base filename.

The syntax for basename is:

basename path [suffix]

where path is the file path and suffix is an optional argument that specifies a suffix to remove from the filename.

For example, if the file path is /usr/local/bin/script.sh, running the command basename /usr/local/bin/script.sh will return script.sh. If a suffix is specified, such as basename /usr/local/bin/script.sh .sh, the command will return script.

basename is often used in shell scripts to manipulate file names and paths.




(追記) (追記ここまで)


Add Comment

JavaScript must be enabled for certain features to work
* Required information
1000

Comments

No comments yet. Be the first!
(追記) (追記ここまで)
(追記) (追記ここまで)

AltStyle によって変換されたページ (->オリジナル) /