`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
0
votes
3 answers
running subprocess with combined cd and pwd
I run subprocess in jupyter to get the core path.
I have to go one folder up and then call pwd
Running:
import subprocess
mypath=subprocess.run("(cd .. && pwd)")
leads to a "No such file or directory: '(cd .. && pwd)' error. I guess the cd calls a…

Florida Man
- 2,021
- 3
- 25
- 43
0
votes
1 answer
Qbs cannot get PWD file on MacOS
I want to use my script as cpp.compilerWrapper: ["../../script"]
I'm using relative path (from my .qbs file) to point the script. It works OK na linux. but on macOS doesn't.
Also when I'm using
var path = Environment.getEnv("PWD") on linux return…

AnDevi
- 67
- 7
0
votes
1 answer
How do get the working directory after a cd in a makefile?
I just need to be able to assign the value of pwd after cd to a variable so I can open a file in my web browser, but I can't seem to figure out how to do that in a Makefile. Interestingly, when searching other answers about people who want to get…

Zip
- 71
- 5
0
votes
1 answer
Tcl print cwd and use it as string
I was making a small script in tcl for VMD:
mol load psf run_1/structure.psf xtc run_1/postDocking_wrapped.xtc
set final [atomselect top "not (water or ions or resid 1216)" frame last]
$final writepdb last_frame.pdb
puts "finished!"
quit
I wish i…

Ludovico Pipitò
- 47
- 8
0
votes
0 answers
$pwd vs $(pwd) vs `pwd` vs ${pwd}
I am writing a groovy script in jenkins, and when trying these commands I'm getting different outputs not knowing what exactly the difference and what is the need for each one of these.
Furthermore, the output of same commands is different between…

anonymous
- 37
- 7
0
votes
2 answers
Get the current working directory or any directory with "/" instead of "\" in powershell script
In order to deliver the current working directory adress to a program. I need to provide the directory Path separated by forward slashes /. The program does not accept a string containing backslashes.
Currently, the pwd-Command delivers the…

Sandwichnick
- 1,379
- 6
- 13
0
votes
1 answer
$(dirname $PWD) is returning null or is empty
I am new to SBATCH and bash. I have a simple script to submit the job and I am trying to get the parent directory of the current working directory. It seems from the documentation that '$(dirname $PWD)' is the way to do it. But it always returns…

RforResearch
- 401
- 8
- 16
0
votes
2 answers
How can i make grep show a line ignoring the words i want?
I am trying to use grep with the pwd command.
So, if i enter pwd, it shows me something like:
/home/hrq/my-project/
But, for purposes of a script i am making, i need to use it with grep, so it only prints what is after hrq/, so i need to hide my…

Henrique Monteiro
- 107
- 1
- 1
- 9
0
votes
1 answer
shell alias executes in home directory
I have following line in my .zshrc file:
alias clean="sed -i 's/\r//g; s/ /\t/g' $(find . -maxdepth 1 -type f)"
but when I try to execute it in /path/to/some/directory the output is:
sed ./.Xauthority
./.lesshst: No such file or…

beardeadclown
- 327
- 2
- 14
0
votes
1 answer
Airflow on windows 10 - Module not found errors
I'm new to data science and wanted to do a little tutorial, which requires airflow, among other things. I installed it on windows using git bash in VS Code. I tried running it but it had a problem not being able to load the sqlite3 import
command…

gcr
- 443
- 2
- 5
- 14
0
votes
1 answer
How to get the docker-machine IP in Play With Docker (PWD) environment?
I'm following the tutorial in https://docker-curriculum.com/. When I run a docker container with a static website (docker run -d -P --name static-site prakhar1989/static-site) I can't access the web application because I have not the IP address of…
0
votes
1 answer
How to get relative path of dir?
I`m implementing pwd builtin in mini shell.
How could I get relative path without using environment variable "PWD"
(getenv("PWD"))
Example:
CWD = /tmp
getcwd("/tmp", buff, size)
returns absolute location => /private/tmp.
How can I get "/tmp"…
0
votes
1 answer
How to run a command with no args in 'spawn'
Hello I am trying to run terminal commands from NodeJS and am trying to use the spawn command, I had been using exec but am trying spawn now for the stdout.
All the examples I've bene reading, like this one:
Exec : display stdout "live"
Use commands…

Martin
- 1,336
- 4
- 32
- 69
0
votes
2 answers
How to create an alias with relative pwd + string
I want to set an alias to switch from two WordPress instances on the CLI. Each of them have the same paths except for the names of their respective sites…

Haddly
- 79
- 1
- 2
- 9
0
votes
1 answer
How to print path of a file properly?
Trying to make a pwd for the c shell. This is what I found on a website and wanted to learn more about it.
I have use debugging printf statements all the way through the program already and it returns the "." instead of the actual dir name all the…

sh3kk
- 1
- 2