Questions tagged [pwd]

`pwd` is a shell command for "print working directory". When issued, it prints the path of the current working directory.

149 questions
0
votes
1 answer

Bash: unexpected behavior using a variable containing directory with escaped spaces

This is a follow up to https://apple.stackexchange.com/questions/52459/ and is about an unexpected behavior in bash. To summarize what's in that link, the problem is to copy the current directory in Terminal to a temporary variable, say the…
0
votes
2 answers

Making c++ app use directory of file, not pwd

I am trying to run an application, app. I do this by running ./app in the directory of app. This application has a dependency, graphics/file.bmp. Everything works when I run ./app in that directory. If I instead run from the parent folder, it can't…
Chet
  • 1,209
  • 1
  • 11
  • 29
0
votes
1 answer

How do I print the current working directory of another user in linux?

Is there a command line I can issue to see what directory another user is currently working in? This would be like using >pwd but for the other user.
John Lewis
  • 712
  • 7
  • 15
0
votes
1 answer

Gunicorn not work outside project directory, even export PWD=$DJANGODIR

I use a bash script to run gunicorn. It is named _run_gunicorn.sh_ #!/bin/bash NAME=new_project DJANGODIR=/home/flame/Projects/$NAME SOCKFILE=/home/flame/launch/web.sock USER=flame GROUP=flame …
Frozen Flame
  • 3,135
  • 2
  • 23
  • 35
0
votes
1 answer

Copying files from a local directory to an online cluster

How can I copy a file from a local directory to an online cluster, while I'm logged in the cluster? Let say I'm currently at online-user@ldas-grid which pwd gives me /home/online-user and I want to copy a file to above mentioned online cluster…
Rotail
  • 1,025
  • 4
  • 19
  • 40
0
votes
2 answers

Emacs, change of $PWD variable

I do always work with emacs in no windows mode (emacs -nw) inside Guake, and I have set guake to open a new tab in the same directory on which I'm in that moment. My purpose is: If I work with a certain file in emacs, and I open a new tab, I want…
ABu
  • 10,423
  • 6
  • 52
  • 103
0
votes
1 answer

Equivalent of pwd.h lib of c++ in java

I have found a link that illustrates the use of getting pwd based in the uid of the user. I have a similar requirement in java for running a script as a different user which needs this implemetation. The code snippet in c++ is as below: static void…
Galaxin
  • 474
  • 2
  • 9
  • 21
0
votes
1 answer

Bad use of parentheses

I've been stuck on this for hours: cd /dir1 (cd $HOME); pwd; Why does pwd still say /dir1 and didn't go to my home directory?
Jurgen Malinao
  • 149
  • 1
  • 1
  • 5
0
votes
1 answer

How can i reach as variable of /src last folder in shell script?

this sh script is in /w that named "install.sh" i want to catch my directory last name "bes" where is /src/com/seri/bes #!bin/bash i use myendpath=${PWD##*/}at this line but variable return "w"; myendpath=ls…
natrollus
  • 321
  • 1
  • 4
  • 11
-1
votes
3 answers

How to extract the parent folder in bash script?

In a bash script, I want to extract the 2 last folders of the pwd. I did this : value=`pwd` echo "you are here : $value" echo "the folder is: ${value##*/}" To have this : you are here: /home/user/folder1/folder2 the folder is folder2 Now I want to…
-1
votes
1 answer

Store current directory in variable and use a variable to store the path developed from the previous variable

I need to store the current directory into a variable, so i did: $current_path='pwd' Till this point it is correct, but if I use the below one: MY_FOLDER=$current_path/subFolder1/subFolder2/MyFolder/ and do $MY_FOLDER I am getting an…
Girija Vk
  • 1
  • 3
-1
votes
1 answer

How to use $PWD in a Bash script

I am writing a small Bash script to do some automatic commands. In particular, I would like to save the current directory path in a variable called my pwd and then use mypwd to change directory. I have tried the following lines with no…
alie
  • 63
  • 1
  • 9
-1
votes
1 answer

Shell Error no such file or directory BUT USED PWD

Why is this not working please help ! Why is the pwd in the code not working , both scripts are in the same file Here is the code : check_process() { echo "$ts: checking $1" [ "$1" = "" ] && return 0 [ `pgrep -n $1` ] && return 1 || return…
7mo0ode2
  • 21
  • 1
  • 4
-3
votes
2 answers

python on linux - use 'pwd' module to read passwd file of remote machine

I am executing a python script on one server and needing to read the contents of the passwd file from a remote machine. Does anyone know of a way to do this? Normally I would do: import pwd pwlist = pwd.getpwall() #perform operations This only…
SheerSt
  • 3,229
  • 7
  • 25
  • 34
1 2 3
9
10