Questions tagged [pwd]
For questions about the working directory of processes, as well as the `pwd` command
110 questions
5 votes
2 answers
534 views
Why doesn't the pwd nullary built-in error when provided an argument, whereas the nullary/unary exit built-in does error?
If I enter pwd foo bar at the prompt of the bash shell, the foo bar part of the command line seems to be completely ignored. If I enter exit 0 foo, I get bash: exit: too many arguments. So pwd ignored ...
1 vote
1 answer
139 views
Bash `cd -L` vs. `cd -P` vs. Bash Reference manual description
Premise I've read what's listed in Bibliography regarding cd, pwd, set -P. By default, or when the -L option is supplied, symbolic links in directory are resolved after cd processes an instance of ‘.....
0 votes
1 answer
248 views
Can I reprogram the pwd command to add a trailing slash?
WHen I use the pwd command, it prints e.g /opt instead of /opt/. I would like it to print the trailing slash. However, I tried adding the following line to my ~/.bash_aliases file: alias pwd=" ...
32 votes
1 answer
3k views
How to get the cd shell-builtin to stop guessing?
For example: $ ls -aF ./ ../ bin/ $ cd tin # with a tee, not bee bin $ pwd /home/user/bin In other words, cd guesses that what I really meant was cd bin, and successfully (huh?) changes the current ...
1 vote
1 answer
132 views
Enter directory without knowing its name?
Suppose we have a user pepe who has a directory ~/pepe_cant_see in his home directory in which he possesses -wx permissions, and inside of this directory, another directory ~/pepe_cant_see/...
13 votes
1 answer
21k views
What is the difference between cwd and pwd?
What is the difference between cwd and pwd? I've tried googling it, and one of the answers mentioned that depending on some factor (which I sadly do not remember), the implementation (the code I'm ...
1 vote
1 answer
712 views
Display recursively all parent directories relative to the current one
Display recursively all parent directories relative to the current one. #!/bin/bash IFS=/ for var in $(pwd) do echo "$var" done
0 votes
1 answer
51 views
How to list contents my present directory but only show the absolute file path and name?
I have an alias: alias lp=find $(pwd) I would like this to be similar to ls and ll (list path) but this command searches through every directory instead of my present working directory. I would ...