pwd(1T) Tcl Built-In Commands pwd(1T)__________________________________________________________________________________________________________________________________________________NAME
pwd - Return the absolute path of the current working directory
SYNOPSIS
pwd
_________________________________________________________________DESCRIPTION
Returns the absolute path name of the current working directory.
EXAMPLE
Sometimes it is useful to change to a known directory when running some external command using exec, but it is important to keep the appli-
cation usually running in the directory that it was started in (unless the user specifies otherwise) since that minimises user confusion.
The way to do this is to save the current directory while the external command is being run:
set tarFile [file normalize somefile.tar]
set savedDir [pwd]
cd /tmp
exec tar -xf $tarFile
cd $savedDir
SEE ALSO file(1T), cd(1T), glob(1T), filename(1T)KEYWORDS
working directory
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tclpwd(1T)
Check Out this Related Man Page
pwd(1) User Commands pwd(1)NAME
pwd - return working directory name
SYNOPSIS
/usr/bin/pwd
DESCRIPTION
The pwd utility writes an absolute path name of the current working directory to standard output.
Both the Bourne shell, sh(1), and the Korn shells, ksh(1) and ksh93(1), also have a built-in pwd command.
ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of pwd: LANG, LC_ALL, LC_MESSAGES, and
NLSPATH.
EXIT STATUS
The following exit values are returned:
0 Successful completion.
>0 An error occurred.
If an error is detected, output will not be written to standard output, a diagnostic message will be written to standard error, and the
exit status will not be 0.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|CSI |Enabled |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|Standard |See standards(5). |
+-----------------------------+-----------------------------+
SEE ALSO cd(1), ksh(1), ksh93(1), sh(1), shell_builtins(1), attributes(5), environ(5), standards(5)DIAGNOSTICS
``Cannot open ..'' and ``Read error in ..'' indicate possible file system trouble and should be referred to a UNIX system administrator.
NOTES
If you move the current directory or one above it, pwd may not give the correct response. Use the cd(1) command with a full path name to
correct this situation.
SunOS 5.11 2 Nov 2007 pwd(1)
Hi Folks,
In a Unix (ksh) script, is there a way to determine the current working directory path of another logged-in user? Of course, I can use "pwd" to find my own path. But, how do I find it for another active user?
Thanks for any input you can provide. LY (6 Replies)
Hi E(uni)xperts,
I have a file in which I need to replace some text with the current path of the execution.
meaning..
if I am running from
/user/oldtrash/scripts and the file contains
"this is ur directory current_dir"
then I should see the file content as
"this is ur... (6 Replies)
The root pwd on an hpux11i box was changed by an ex-employee. Is there anyway to reset it without shutting down the machine? If not how can I do it..
Thanks in Advance
Brian (6 Replies)
Phew simple question,
I want to display the my directory path in prompt.
Did the following in .profile
PS1=`pwd`
export PS!
Worked, but it always points to HOME directory.
When i do a cd, it doesn't change.
What am i missing.
Thanks (7 Replies)
Hi--
I'm trying to use the cp command, and I keep getting there is no such directory. But I've checked, and the directory is certainly there.
Please keep in mind this is OS X, 10.4.4 to be exact.
Here's my output:
myuser$ cp -r "/Firewire 400/users/myuser/new Files/Flip4Mac WMV.mpkg"... (7 Replies)
Hi,
I want to change my command prompt to contain the current username and the current directory in it, instead of just the '$' symbol.
I tried the command:-
export PS1="$(echo \\n$) "
But whenever I switch the user or change the directory, the changes are not reflected in the command... (10 Replies)
Here is my script
#!/bin/bash
pwd
cd /var/lib/pgsql
Both "pwd" and "cd" are not executed is there any other way i can change the current working directory to /var/lib/pgsql pls help! (9 Replies)
Hi,
I have installed opensolaris 10 in VMware. Everything is fine except ls command is not working. It is not displaying any files and directories. Sorry if the question is soo trivial. (8 Replies)
Hi,
i want to remove a certain pattern when i type pwd.
pwd will look like this:
..../....../....../Pat_logs/..../....../...../......
the dotted lines are just random directory names,
i want it to remove the "Pat_logs/...../....../....../" part
so for example:
... (8 Replies)
Assume that you want to set your prompt to display the current working directory followed by a percent symbol and then a space. The command pwd can be used to display this information, so explain why the following command does not have the expected result:
set prompt=" `pwd`'%' "
Its a... (7 Replies)
Hi,
Is there a command that tells you right away the current working directory? I know the command "pwd", but that one gives the full path.
if pwd gives me:
/a/b/c/d/ggg/HERE
I want something that will give me:
HERE
Thanks,
Gaurab (13 Replies)
I decided I wanted to have the cd command print my full working directory after each cd command, so I put this cw command in .bashrc as a function.
cw ()
{
cd "${1}"
pwd
}While this works I would like pwd to print escapes when a space in a directory name exists. This would... (7 Replies)
I have a script which takes backup of some configuration files on my server. It does that by using an array which contains the complete path to the files to backup.
It copys the files to a pre defined dir. Each "program" has it's own folder, ex. apache.conf is being copied to /predefined... (7 Replies)
Dear all,
I am trying to use 'pwd' command in following way.
current_directory == /dirA/dirB/test/dirC
if ; then
do this
fi
I am not sure how to pass this in command way. Please help!
thanking you,
emily (10 Replies)