`pwd` is a shell command for "print working directory". When issued, it prints the path of the current working directory.
Questions tagged [pwd]
149 questions
3
votes
1 answer
awk change working directory within a script
I want change a working directory in an awk script:
...
path="./some/path"
system("pwd") ; \
current_dir=system("pwd") ; \
pushd_cmd="pushd " path ; \ # a "cd" doesn't work too
print pushd_cmd ; \
system(pushd_cmd) ; \
…

static
- 8,126
- 15
- 63
- 89
2
votes
2 answers
How to find all symbolic link in PWD which refer to files outside of PWD? unix
i can find all link in dir by command:
find . -type l
But i need link which only refer to files outside of PWD.
Can anybody say how to do it?
Thanks.

D shell
- 45
- 7
2
votes
7 answers
Tools built into the shell
I was wondering about tools that are built into the bash shell. For example, type pwd tells me that pwd is built into the shell.
whereis pwd
/bin/pwd /usr/include/pwd.h /usr/share/man/man1/pwd.1.gz
aptitude search pwd
does not (seem to) give…

Emanuel Berg
- 499
- 4
- 14
2
votes
3 answers
Is there a clean way to check if a given user exists on a computer through python?
Currently I am using pwd.getpwall(), which shows me the entire password database. But I just want the users accounts of the computer. And with using getpwall() I am unable to do this ...
if 'foo' in pwd.getpwall():
do stuff
since…

huan
- 1,121
- 2
- 8
- 6
2
votes
4 answers
Docker COPY no such file or directory
Building docker image fails on copy task. No such file or directory. I am using the hello world example from spring
Building from openjdk:8-jdk-alpine
Run echo ${PWD} prints /
Run ls prints a set of normal directories (/usr /var etc) but no project…

Bato-Bair Tsyrenov
- 1,174
- 3
- 17
- 40
2
votes
0 answers
SparkR: source() other R files in an R Script when running spark-submit
I'm new to Spark and newer to R, and am trying to figure out how to 'include' other R-scripts when running spark-submit.
Say I have the following R script which "sources" another R script:
main.R
source("sub/fun.R")
mult(4, 2)
The second R script…

Joe J
- 9,985
- 16
- 68
- 100
2
votes
1 answer
Unix: command to strip white space characters
When I do the following unix command:
pwd | pbcopy
is there something I can add to the command so that the string copied to my clipboard does not have any trailing whitespace?
(fyi: The reason I ask is because when I pipe the output to pbcopy, it…

well actually
- 11,810
- 19
- 52
- 70
2
votes
1 answer
Make the ssh connection and enter the sudo password fully automatically
I want to make ssh connection automatically and install a packet to the connected machine. I'm able to process the SSH connection automatically. I can even run commands that do not require sudo authorization. But I didn't find a way to automatically…

Ali.Turkkan
- 266
- 2
- 11
2
votes
1 answer
How do I create a variable named for the folder that is my current working directory?
I want to create a variable that's value is the name of the folder that I am working in. I can use pwd to see the working directory but I cannot figure out if there is a way to save the pwd output as a variable or better yet make a variable with…

Alison S
- 43
- 3
2
votes
0 answers
Platform-independent way to get the user's home directory in C++
Currently, when I want to get the user's home directory in C++, I do:
#include
const char* get_home_directory() {
struct passwd *pw = getpwuid(getuid());
return (pw == nullptr ? nullptr : pw->pw_dir);
}
but this relies on getpwuid,…

einpoklum
- 118,144
- 57
- 340
- 684
2
votes
2 answers
Odd behaviour of pwd with symlinks in terminal tabs
If I create a symlink through
ln -s /path/to/linked/dir current/path/link_name
and change the directory to current/path/link_name via
cd link_name
then I can check where I am using pwd-command. The output will be
current/path/link_name
But if I…

Анатолий Ширыкалов
- 29
- 2
2
votes
2 answers
Please explain . ./ab_project_setup.ksh $(pwd) statement
Please explain the meaning of this statement
. ./ab_project_setup.ksh $(pwd)

Srihari
- 2,509
- 5
- 30
- 34
2
votes
3 answers
How can I manipulate PWD directly?
I knew that there is a variable PWD which is changed when I type the command cd. But when I try to change it manually the current directory isn't changed. How to manipulate PWD directly?

David Tsaturyan
- 67
- 11
2
votes
1 answer
Error wihle installing pwd module on windows
I am trying to install "pwd" module using easy_install on windows and running into below error,can anyone help how to fix this error?
C:\Dropbox\scripts>easy_install pwd
Searching for pwd
Reading http://pypi.python.org/simple/pwd/
Couldn't find…
user5007666
2
votes
4 answers
shell built in pwd versus /bin/pwd
I would like to know the code implementation of built-in pwd and /bin/pwd especially when the directory path is a symbolic link.
Example:
hita@hita-laptop:/home$ ls -l
lrwxrwxrwx 1 root root 31 2010-06-13 15:35 my_shell ->…

hits_lucky
- 327
- 2
- 9
- 18