Questions tagged [pwd]

pwd means show the present working directory.

pwd is a UNIX term meaning show the present working directory for the current user.

14 questions
2
votes
1 answer

Formatting pwd/ls for use with scp

I have two terminal windows with bash. One is local on the client computer, another one has an SSH-session on the server. On the server, I am in a directory and seeing a file I would like to copy to my client using scp from the client. On the server…
eumiro
  • 983
2
votes
1 answer

How to change terminal to include

How can i make my shell prompt read: $
JAM
  • 489
1
vote
1 answer

Windows symlink does not show full path?

Current pwd: C: I created a sample symlink say: mklink /j C:\a C:\b\c Thereafter after i navigate using the symlink: cd a If I execute the 'pwd' command, I see the path as C:\a Is there a way so that I can see the actual path…
Coder
  • 476
  • 1
  • 4
  • 12
1
vote
1 answer

ZSH Colorize the PWD output in aliases

NOTE: Yes, This is on Mac OS 11.6.2 Big Sur. Right now I have zsh aliases in the .zshrc file to make terminal navigation easier. I thought I'd try to colorize the PWD output, but what happens is that the output is the previous directory. I've added…
MaxRocket
  • 111
1
vote
1 answer

How to force linux to print full path along with timestamp while using find

I need to store the full path of a specific file found through find (and successive piped operations on find results). I'm using this: find "$PWD" . -iname p_*.raw -printf "%Tc %p\n" | sort | cut -f 7 -d " " However, as it is it produces…
1
vote
2 answers

Linux symlinks to directories

I created a symlink in my home folder to another directory: $ pwd /home/user1 $ ln -s /usr/local/dir/ shortcut $ ls -l ................................... shortcut -> /usr/local/dir/ $ cd shortcut $ pwd /home/user1/shortcut I do end up in that dir…
prl77
  • 272
1
vote
1 answer

Changing my shell bash script default $PWD to it's (the script's) current location

Hey I'm running my shell script that interacts with folders and files, but my $PWD that it keeps pointing to /home/MyUserName directory and this messes with what it is supposed to do. I am running Linux 4.4.8-300.fc23.x86_64…
Purpe_Fedora
  • 67
  • 11
0
votes
1 answer

Reverse a default flag

As a context. I have a folder which I have symlinked into my $HOME directory. ~> ls -s /var/www/to_link "$HOME/linked" I cd into "$HOME/linked" So, by default, pwd shows the current directory including symlinks. In this case, it would be…
0
votes
2 answers

SSHFS: get real pwd on original server?

I have connected one of my production server folders with my "ssh account" server via sshfs. I often need to find out pwd (or realpath) of the file on the original (production) server, but the pwd returns the path to file on the connected ("ssh…
Adam Kiss
  • 123
  • 7
0
votes
1 answer

Make an alias work in "that" directory? Even if created in .zshrc

This is zsh but perhaps applies to other shells. Say you are in directory /foo and you % find $PWD -name '.*' it works fine, results are from /foo. Now (in /foo) type this % alias crazy="find $PWD -name '.*'" Now go % crazy and you'll see the same…
Fattie
  • 229
0
votes
0 answers

WSL zsh - Trim working directory if it contains a certain folder

I'm using WSL to run ohmyzsh on my win 10 machine. I have a repository folder in which I keep my git repositories, and it is my most common working directory. I want to be able to conditionally hide the prompt working directory that comes before…
J Lewis
  • 111
0
votes
0 answers

Why does get-psDrive not return the currentLocation for some drives?

I have two drives on the computer I am currently working: c: and d:. When I switch between these cd c:, cd d:, PowerShell remembers the location of the last path I was in the respective drive. I believe this path should be accessible by the value of…
0
votes
1 answer

Create a lot of Symlinks with pwd and regular expressions and space in path

I'm trying to create a script in order to keep the files with the same extension in a folder separated from the rest. In particular, I want a script that, executed in a folder, create soft links of all .tex files and put them in a subfolder…
Exodd
  • 141
0
votes
1 answer

Bash PS1 and single vs. double quotes

I'm a linux and Bash newbie and would like to ask help understanding the role of single and double quotes when assigning the PS1 env var. I wanted to set the terminal to always show the current directory. At first I tried this: export…
StoneThrow
  • 1,317