Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dirname(1) [ultrix man page]

dirname(1)						      General Commands Manual							dirname(1)

       dirname - deliver directory names from pathname

       dirname string

       The command delivers all but the last level of the path name in string.

       The following example sets the Bourne shell variable NAME to
       NAME=`dirname /usr/src/cmd/cat.c`

See Also
       basename(1), sh(1), sh5(1), ksh(1)


Check Out this Related Man Page

mvdir(1M)						  System Administration Commands						 mvdir(1M)

mvdir - move a directory SYNOPSIS
/usr/sbin/mvdir dirname name DESCRIPTION
mvdir moves directories within a file system. dirname must be a directory. If name does not exist, it will be created as a directory. If name does exist, and is a directory, dirname will be created as name/dirname. dirname and name may not be on the same path; that is, one may not be subordinate to the other. For example: example% mvdir x/y x/z is legal, but example% mvdir x/y x/y/z is not. OPERANDS
dirname The name of the directory that is to be moved to another directory in the filesystem. name The name of the directory into which dirname is to be moved. If name does not exist, it will be created. It may not be on the same path as dirname. USAGE
See largefile(5) for the description of the behavior of mvdir when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXIT STATUS
0 Successful operation. >0 Operation failed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
mkdir(1), mv(1), attributes(5), largefile(5) SunOS 5.11 14 Mar 1997 mvdir(1M)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

I know this is Unix....But Does anyone know something about Linux

I have to login to a linux machine and I need help with chmoding a directory so that I may copy read and write to it if you know what muds are and you know about logging into a shell, then you know what im talking about! well thanks! :confused: (2 Replies)
Discussion started by: jarrell
2 Replies

2. UNIX for Dummies Questions & Answers

Original Path

I've got one I haven't been able to figure out. 1. A shell script exists- /junk/junk1/junk2/ 2. From within the above named shell script, I want to know the full path of the above named shell script. Even if I execute the shell script from a directory other than the one it resides in,... (5 Replies)
Discussion started by: therealtiger
5 Replies

3. UNIX for Dummies Questions & Answers

Unix History Question: Why are filenames/dirnames case sentsitive in Unix?

I tried looking for the answer online and came up with only a few semi-answers as to why file and directory names are case sensitive in Unix. Right off the bat, I'll say this doesn't bother me. But I run into tons of Windows and OpenVMS admins in my day job who go batty when they have to deal... (3 Replies)
Discussion started by: deckard
3 Replies

4. Shell Programming and Scripting

Setting basename and dirname variable to simply script.

Hello all, Can somebody explain to me how set up a basename and dirname variable to simplify this script. I currently have a 'infile' with the contents of FTTPDataPVC_ & BaaisDSLFeed. I need to add a basename and or dirname variable so that any additions can be made through the infile and not... (1 Reply)
Discussion started by: liketheshell
1 Replies

5. Shell Programming and Scripting

strip hostname from dirname?

I need to get the full path of a file minus the hostname... anyone have an easy way to do this? What I have is: //ourhostname/ourfullpath/filename What I need is: /ourfullpath/filename hostname evaluates to 'ourhostname' dirname evaluates to '//ourhostname/ourfullpath' basename... (2 Replies)
Discussion started by: tink
2 Replies

6. Shell Programming and Scripting

dirname, save cut portion to variable, clean up

Hi guys, last cry for help for today. I appreciate the help so far. ok so I have a program that dumps a path into my script as a variable ($1) This path is an example /home/xbmc/sab_downloads/video/tv/grey's anatomy/season 3 So in order to search for a show, I need to extract... (6 Replies)
Discussion started by: tret
6 Replies

7. Shell Programming and Scripting

geting the real path

Hi there, Is there any way to obtain a real path from a weird path. For example : /foo/../bar/ -> /bar/ /foo/. -> /foo/ Thanks in advance Santiago (5 Replies)
Discussion started by: chebarbudo
5 Replies

8. Shell Programming and Scripting

find & dirname:problems with white spaces in Directories

Hi all, my problem: (little extract from my bash-script) I want to move each file (.mov) from one directory (and many Subdirectories) to another directory (only one); after moving i want to create hardlinks to the old directories. Thatīs no problem, but now: source-directories... (4 Replies)
Discussion started by: tubian
4 Replies

9. Programming

basename and dirname changes the value of argument???

Hi I faced with some interesting behavior of basename and dirname functions from libgen.h: they changes the value of argument! Here is the declaration: char *basename(char *); char *dirname(char *);It makes some tiresome to use them... I am new to C and maybe I do something wrong, but to... (4 Replies)
Discussion started by: Sapfeer
4 Replies

10. Shell Programming and Scripting

[bash] Manipulate dir name

Hi as output i get a directory (i don't know its name) with many files inside. Now i need to find the directory name and change it as i need. I can found a directory name with this command: find -maxdepth 1 -type d | grep out Now i'd like to assign it to a variable and change it. ... (4 Replies)
Discussion started by: Dedalus
4 Replies

11. Shell Programming and Scripting

absolute path for a script ran with relative path

I have a script in which i want to print absolute path of the same script irrespective of path from where i run script. I am using echo "pwd : `pwd`" echo "script name: $0" echo "dirname: `dirname $0`" when i run script from /my/test/dir/struct as ../ the output i... (10 Replies)
Discussion started by: rss67
10 Replies

12. UNIX for Dummies Questions & Answers

$dirname ??????

Hi, okay, the following command was given to me in a script, but it's not working and there's little to no help on dirname. What is wrong with the following line? I'm just trying to save the current directory to use later in subsequent scripts. MYAPPDIR=$(dirname $(dirname $0)) Thanks. (2 Replies)
Discussion started by: rebazon
2 Replies

13. Shell Programming and Scripting

help with dirname

We are using #!/bin/sh From a command line this command returns the correct list of files (without going into any subdirectories) find /* -prune -type f -print We have a script which takes the same path as $1 (without the * ) ... (2 Replies)
Discussion started by: 15a0
2 Replies

14. Shell Programming and Scripting

Using dirname on a file before uniq

Hello, I have a list of files generated like this: find dir -type f > file_list I want to get a list of just the unique directories. I can't create a temporary file. So the idea is to do a working equivalent to this: cat file_list | dirname | uniq But of course that doesn't... (4 Replies)
Discussion started by: brsett
4 Replies

15. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies