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
0 answers

for f in $PWD subfolders

I'm running a script that verifies the integraty of a video file in my current folder. But only counts for my current folder and I want also to search files in the subfolders of $pwd. What should I add in $(ls $PWD/*.mp4) ? Thank you #!/bin/bash #…
fdroid
  • 13
  • 1
  • 6
0
votes
1 answer

Logging the location on the server - Robot Framework/CMD

I'm trying to log in to the database server with applications run there. I can login without any problems, however when I try to log the working directory on the server it shows me the default directory after logging in and not the one i…
Mateusz
  • 171
  • 1
  • 1
  • 12
0
votes
1 answer

Getting the previous working directory value

here is my simple command. ls -lrth ../ | grep file | awk -F" " -v orig=`cd .. | pwd ` -v sort=`pwd` '{print $NF "," $7"/"$8"/"$9","orig"," sort }' I'm trying to get the value of my previous path just above my current working directory. current…
0
votes
1 answer

SVN INFO fails in PowerShell when CD'ing into a working copy while spelling the directory name with wrong letter case

When I use Set-Location (aka cd) to change the current directory in a PowerShell window, but deliberately avoid auto-complete and type the name in the "wrong" case... PS C:\> Set-Location winDOWs ...then Get-Location (aka pwd) will return that…
Good Night Nerd Pride
  • 8,245
  • 4
  • 49
  • 65
0
votes
1 answer

Python subprocess pwd inconsistent when file structure includes alias

When I run the following script #!/usr/bin/env python import subprocess print(subprocess.check_output(["pwd"])) the result is /scratch1/name/Dropbox (NAM)/docs/research/Y2/results/s8 whilst from my Ubuntu terminal, the…
Fab von Bellingshausen
  • 1,387
  • 1
  • 8
  • 16
0
votes
2 answers

move many directories to another directory using CLI

I want to copy some of the directories in a directory to another directory in that directory itself. For Example: I have the structure like the below myname@compname:~/root/app/pages$ ls dir1, dir2, dir3 I want the dir1 and dir2 to be moved into…
gsthina
  • 1,090
  • 8
  • 22
0
votes
1 answer

Printing file paths using bash

I am a student learning bash. I am currently trying to print a series of absolute file paths to run additional scripts with. Currently echo $PWD, *In does not work. My file structure looks like. /home/hayden/myProject/gene within this directory…
Nicholas Hayden
  • 473
  • 1
  • 3
  • 24
0
votes
1 answer

Find absolute path of a directory *relative* to the current directory

pwd gives the absolute path to the current directory. Is there a way to give the absolute path of a directory relative to the current directory? (It's admittedly an almost non-problem.) Normal pwd: [/x/y/z]$ pwd /x/y/z Relative could be…
Michael
  • 7,407
  • 8
  • 41
  • 84
0
votes
1 answer

Why do these rsync parameters create an extra parent folder?

I have a very simple bash script that I'm trying to get to work. The goal of the script is to take the current working folder and sync it with the target folder with the same name on an external drive, creating a new folder on the external drive if…
0
votes
1 answer

Ftp Client-Server, my 'cd ..' command messes up my 'pwd' command

On my client-side, if I cd into a directory and pwd it, it'll show me the correct pwd. (ftp> means client-side) ftp> cd adam ftp> pwd remote working directory: amlodoz1/p1/adam But if I then 'cd ..' out of it, and hit pwd, it gives me this: ftp> cd…
Homerdough
  • 353
  • 1
  • 3
  • 12
0
votes
1 answer

How does a MATLAB generated binary knows its fullpath?

I have a MATLAB compiler generated binary (exe/jar/dll). I would like to be able to get the full path of the binary itself at runtime. Any ideas? Help will be very appreciated.
Hanan Kavitz
  • 1
  • 1
  • 2
0
votes
2 answers

How can I use the output from pwd as a variable?

My homework question given is: How can you print the path of the current directory (working directory) and how can you use it as a variable? The first part of the question is easily answered: By using pwd. But how can I use the output as a…
Timothy
  • 608
  • 3
  • 10
  • 24
0
votes
1 answer

Why the command in a file fails to work ? (FreeBSD 10.2)

https://www.youtube.com/watch?v=bu3_RzzEiVo My intention is to experiment with shell scripts in a file. (FreeBSD 10.2) I create a file named script.sh cat > script.sh set dir = `pwd` echo The date today is `date` echo The current directory is…
PPJack
  • 95
  • 1
  • 6
0
votes
2 answers

How to check directory in which script will execute

I'm having problem with storing current path and comparing it with the one user entered. At the moment I have cd $path checkpath="$(pwd)" if [ "$checkpath" == "$path" ]; then chown -Rv $user * and the $path is entered by user. Script fails at…
0
votes
3 answers

pwd doesn't work in windows when I include the git bash command line?

I add the bin of git bash into my path in windows7 for the purpose of using linux command in windows. Other commands like ls, mkdir work fine but when I run "pwd" windows can't execute it. I found there is no pwd.exe in the bin directory. So I want…
Kent Lee
  • 107
  • 4
  • 13
1 2 3
9
10