Questions tagged [cd]

cd is the "change directory" command offered by most shells. For CD-ROMs, please use the [cd-rom] tag.

737 questions
-1
votes
1 answer

Why does `cd` break redirects by `exec`?

I'm trying to redirect parts of the output from a script to a file and have done it like so: #!/usr/bin/bash cleanup() { echo "Lines in $tmpfile:" cat $tmpfile rm $tmpfile } tmpfile=$(mktemp .tmp.`basename $0`.XXXXXX) trap cleanup EXIT for…
azzid
  • 371
  • 2
  • 8
-1
votes
1 answer

CD -- Setting the /d switch on by default

Question Is there a way to change CD so it always assumes the /d switch [change drive as well as path] is set? Further thoughts / considerations I can't think of any situation where I wouldn't want to include /d (i.e. where this would actually…
Martin
  • 280
  • 1
  • 10
-1
votes
1 answer

cmd, batch cd variable space excaping

So i was making a batch file for creating a folder with HTML content. The batch file basically executes a python file, and, as I'm going to make the batch file global, the python file runs with a parameter which is the directory I want to create the…
Tiago Oliveira
  • 47
  • 1
  • 12
-1
votes
1 answer

How to achieve the real cd in python?

I'm writing a tool to make my jump convenient. After executing following command, ./main.py /etc the current path is actually jump to /etc. If I use os.chdir in main.py, then the current path would pop to the original path which is no what I…
hao li
  • 367
  • 2
  • 13
-1
votes
2 answers

I am trying to run PythonScripts and Hatch in the cmd by using the command " cd Downloads/PythonScripts/Hatch"

I am trying to run PythonScripts and Hatch on my cmd by running the command " cd Downloads/PythonScripts/Hatch" but everytime I try this, the response is " the system cannot find the path specified." May I know how to cd into the folder such that…
dianpiggy
  • 9
  • 5
-1
votes
1 answer

How to specify folder location using `cd` command inside exec function?

Instead of specifying root of file for execution in a remote server, how we can use cd command in exec() in nodejs.What i am done is like this. var command_part1 = `ssh -p 22 root@ip`; var command_part2 = `python3 test.py…
lekshmi
  • 338
  • 3
  • 9
-1
votes
1 answer

cd: bad substitution in shell script

Error ./sample.sh[245]: cd: bad substitution This is line 455: BSOld=`cd /opt/siebel/15.0.0.0.0/ses/siebsrvr/webmaster*;ls -lrt | grep *srf* | tail -1 | awk '{print $9}'`
-1
votes
1 answer

Cannot change directory using os.Chdir()

os.Chdir() in golang is not working properly. package main import ( "fmt" "os" ) func main() { command := "cd C:\\" if err := os.Chdir(command[3:]); err != nil { fmt.Println("Error:\tCould not move into the directory…
asd plougry
  • 143
  • 1
  • 9
-1
votes
1 answer

Unable to access file directory and files Centos 7

+x Permission is provided for user and directory is owned by the user. drwxr-xr-x. 3 www-data www-data 19 Nov 30 10:41 www Still, I am unable to access the directory. www-data is Nginx and PHP-fpm user. When I try su www-data I can't access any…
Roshan
  • 16
  • 4
-1
votes
1 answer

Subprocess commands that need each other, special trouble with "cd"

I want a program that, with given arguments, I'm using optpatse, changes the working directory and executes some file. I have tried with: subprocess.check_call(['ls'], cwd="/home") and this works. But if I do: subprocess.call("cd",…
Ajapollo Trukatila
  • 463
  • 1
  • 4
  • 12
-1
votes
1 answer

Error when i install python=3.6.4 version in my virtual environment

I am trying to install python version 3.6.4 on my virtual environment but having errors. I tried using pip install python==3.6.4 but this is giving me error. ERROR: Could not find a version that satisfies the requirement python==3.6.4 (from…
Ashish M
  • 119
  • 8
-1
votes
1 answer

Change Directory to Folder Containing PowerShell Script - Regardless of Where That Folder Is Located

I have a script that I've created to prep our customer's servers for a software install. Part of this requires the script to be run as administrator, so just instructing people to click "Run With Powershell" doesn't get the job done. The script is…
Christopher Cass
  • 817
  • 4
  • 19
  • 31
-1
votes
1 answer

Cannot cd to a directory returned by an exe program

I have this simple file: tags home C:\Users\rodde docs C:\Users\rodde\Documents prev D:\ dt C:\Software\dt The first column contains the tags, and the second column contains respective directories. Also, I have a program (dt.exe) that expects a tag…
coderodde
  • 1,269
  • 4
  • 17
  • 34
-1
votes
1 answer

cd with a literal vs a variable leads to git either being discoverable or not

This may be a very basic question, although all responses I could find for it were to "install git" or "be in a git directory." As far as I can see, both of these are resolved already, yet my issue persists. Although the solution could be trivially…
Skenvy
  • 724
  • 1
  • 4
  • 15
-1
votes
1 answer

Alternative to using Flash Projector as Autorun Interface?

I have been given the task of creating an Autorun installer for a distributable CD, and thought I would challenge the task with Flash. In previous versions of flash it was possible to use fscommand and trickery to run other local exe files, but due…
Christian
  • 1
  • 1