All Questions
Tagged with working-directory or pwd
109 questions
1
vote
1
answer
70
views
Is there a built-in way to copy a file from current directory to previous directory? [duplicate]
My pwd is /long_path/lots/of/subs/waydeep/. If I cd -, it will return me to /lastdirectory/long_pathway/very_deep/.
Is there a shortcut terminal/cli command to copy file1.ex from the current working ...
1
vote
1
answer
135
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
479
views
Open a new window in tmux only if no window is opened in the given path, otherwise attach to it
Currently I have my terminal (alacritty) run tmux new -A -s 0 at start to start a new session 0, or attach to it if it already exists. One problem is, I sometimes use open in directory from file ...
0
votes
1
answer
244
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=" ...
3
votes
1
answer
2k
views
Interactive bash shell: Set working directory via commandline options
The short question is: I need to launch an interactive bash in a certain directory, and I can craft the command that launches bash, but I can't modify the system. At the moment, the command that best ...
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 ...
0
votes
1
answer
307
views
pwd add '\' in folder spaces
i know that on Linux when you try to cd with folder that have spaces you must add \ in there.
for example, i have folder named folder one.
when i try pwd the output is :
/home/user/folder one
what i ...
1
vote
1
answer
130
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/...
15
votes
1
answer
3k
views
Why did 'scp 10.0.0.11:/home/someuser/.*' start copying from /home as well?
I'm doing my first ever moving of user files from an old system to a new system. My goal is to use SCP for it's simple syntax of scp -r source destination. I tried the following command to copy the ...
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 ...
0
votes
4
answers
1k
views
How Can I Use the sed Command to Replace /home/user With ~
Suppose this is the output of pwd:
/home/amarakon/.local/src/amarakon/scripts/src
How can I change it to this:
~/.local/src/amarakon/scripts/src
I tried this command:
pwd | sed 's|/home/.*|~|'
But ...
1
vote
1
answer
701
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
2
votes
2
answers
1k
views
Get the Absolute Path from feh
The feh command allows you to view images within a folder recursively:
feh --recursive --auto-zoom
While viewing images, it also allows you to associate custom commands with keys 0-9 on your keyboard....
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 ...
1
vote
1
answer
213
views
Get the unresolved pwd of a shell from another process
I'm hitting an issue where I need to get the unresolved symlink of a shell process. For example given a symlink ~/link -> ~/actual, if bash is launched with a $PWD of ~/link, I need to fetch that ...