Top "Dirname" questions

Getting the parent of a directory in Bash

If I have a file path such as... /home/smith/Desktop/Test /home/smith/Desktop/Test/ How do I change …

bash directory dirname
How do you properly determine the current script directory in Python?

I would like to see what is the best way to determine the current script directory in Python. I discovered …

python pythonpath dirname
php how to go one level up on dirname(__FILE__)

I have a folder structure as follows: mydomain.com ->Folder-A ->Folder-B I have a string from …

php dirname
How to get the last part of dirname in Bash

Suppose I have a file /from/here/to/there.txt, and want to get only the last part of its …

bash shell dirname
How-To get root directory of given path in bash?

My script: #!/usr/bin/env bash PATH=/home/user/example/foo/bar mkdir -p /tmp/backup$PATH And now I …

bash path directory dirname
PHP dirname returns symlink path

Say I have a symlink from '/one/directory/' to '/two/directory/'. If I echo dirname(dirname(\__…

php symlink dirname
Use GNU versions of basename() and dirname() in C source

How do I use the GNU C Library version of basename() and dirname()?. If you #include <libgen.h> …

c posix gnu dirname
How can I determine the current directory name in R?

The only solution I've encountered is to use regular expressions and recursively replace the first directory until you get a …

r command dirname
what is the purpose of require_once dirname(__FILE__) ...?

I am using a php library which has this code: require_once dirname(__FILE__) . '/config.php'; From what I've …

php file require-once dirname
dirname() in C: is the manual wrong?

Citing the manual here: The functions dirname() and basename() break a null-terminated pathname string into directory and filename components. In …

c dirname