Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

dirname(1) [redhat man page]

DIRNAME(1)								FSF								DIRNAME(1)

NAME
dirname - strip non-directory suffix from file name SYNOPSIS
dirname NAME dirname OPTION DESCRIPTION
Print NAME with its trailing /component removed; if NAME contains no /'s, output `.' (meaning the current directory). --help display this help and exit --version output version information and exit AUTHOR
Written by David MacKenzie and Jim Meyering. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for dirname is maintained as a Texinfo manual. If the info and dirname programs are properly installed at your site, the command info dirname should give you access to the complete manual. GNU coreutils 4.5.3 February 2003 DIRNAME(1)

Check Out this Related Man Page

ID(1)									FSF								     ID(1)

NAME
id - print real and effective UIDs and GIDs SYNOPSIS
id [OPTION]... [USERNAME] DESCRIPTION
Print information for USERNAME, or the current user. -a ignore, for compatibility with other versions -g, --group print only the effective group ID -G, --groups print all group IDs -n, --name print a name instead of a number, for -ugG -r, --real print the real ID instead of the effective ID, with -ugG -u, --user print only the effective user ID --help display this help and exit --version output version information and exit Without any OPTION, print some useful set of identified information. AUTHOR
Written by Arnold Robbins and David MacKenzie. REPORTING BUGS
Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT
Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. SEE ALSO
The full documentation for id is maintained as a Texinfo manual. If the info and id programs are properly installed at your site, the com- mand info id should give you access to the complete manual. id (coreutils) 4.5.3 February 2003 ID(1)
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/junk3.sh 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 thetvdb.com 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 test.sh: echo "pwd : `pwd`" echo "script name: $0" echo "dirname: `dirname $0`" when i run script from /my/test/dir/struct as ../test.sh 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 /vol.prod/saptrans/common/test/pa/* -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