Cd is a command-line utility to change the working directory.

learn more… | top users | synonyms

1
vote
1answer
21 views

Are All The Packages Included On The Debian DVD/CD Images Or Just The Most Popular?

My understanding is that Debian and all the software available in the matching online repo (eg: https://packages.debian.org/stable/allpackages) are released together on a series of disc images ...
15
votes
6answers
2k views

Why do I have to cd out of a deleted directory?

On my server I have a directory structure looking something like this: /myproject/code I normally have an ssh connection to the server and 'stand' in that directory: root@machine:/myproject/code# ...
3
votes
0answers
45 views

Call vared and complete files from a different directory

I have the following zsh function which lets me edit symbolic links using the vared ZLE builtin. function lned { emulate zsh setopt err_return extended_glob local_options local_traps local -a ...
0
votes
1answer
17 views

Beginner's question: Accessing network location on domain

I'm new to Linux so this might seem a little naive! So, my computer is connected to a university network, in the computer science department. This domain is called "cs". However, "cs" is a subdomain ...
19
votes
6answers
2k views

where is `cd` located? [duplicate]

In a bash sub shell I get the following error when running cd sudo: cd: command not found This is expected because I don't have a path. Usually to work around this I just provide the full path like ...
0
votes
1answer
72 views

Why does Debian include “cdrom” in sources.list?

Here's my sources.list # deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130$ # deb cdrom:[Debian GNU/Linux 7.0.0 _Wheezy_ - Official amd64 CD Binary-1 20130$ deb ...
6
votes
3answers
378 views

is it possibe to change parent shell's working directory programmatically?

I want to write some code to allow me switching to some directories that I usually go to. Say this program is mycd, and /a/very/long/path/name is the directory that I want to go to. So I can simply ...
1
vote
2answers
56 views

cd ${DIR_PATH} returns 'No such file or directory'

OS = MacOS 10.8.5/Darwin Kernel Version 12.5.0. In my .bash_profile I have: export DIR_PATH=~/concrete/path At the terminal >echo ${DIR_PATH} ~/concrete/path Also explicit cd works: ...
2
votes
4answers
76 views

cd two levels down from root

I'm a web developer (Drupal mainly). When I develop websites I do so within a /workspace folder. So I have folders like this. /workspace/project/ /workspace/project/sites/default/files/ ...
1
vote
1answer
32 views

Commands to read and eject CD?

My laptop is a Thinkpad T400 and the OS is Ubuntu 12.04. I find I have a problem where the CD-RW on my laptop sometimes doesn't read the CD, following some flashing light and sound, after I inserted ...
0
votes
2answers
41 views

Is CDPATH behavior broken in bourne shell (/bin/sh)

I have the following script: #!/bin/sh mkdir -p /tmp/test/foo cd /tmp/test unset CDPATH echo "TEST1: Current working directory: ${PWD}" echo "TEST1: attempting to 'cd foo'" cd foo echo "TEST1: ...
3
votes
1answer
59 views

Getting capabilities of my CD/DVD drive when wodim --devices doesn't work

I used to be able to run either commands successfully on my Fedora 14 Thinkpad T410 laptop: $ wodim --scanbus $ wodim --devices However since upgrading to Fedora 19 this no longer seems to work and ...
1
vote
1answer
76 views

On burning new iso image onto CD (rw type), still the CD reflects the old content!

I had got "Windows repair disc" iso burnt on my CD (of RW type but not sure weather its CD +RW or CD -RW). As its RW, it means the CD can be written multiple times. So, today I want to burn it with ...
20
votes
4answers
2k views

Automatically detect when I typed “vi” but meant “cd”?

Title says it all. About 5 times a day, I type "vi" when I meant "cd", and end up opening a directory in vi. It's making me NUTS. It seems like there should be a way to detect when I type in "vi + ...
12
votes
6answers
651 views

Why does “ls” require a separate process for executing?

Why does ls require a separate process for its execution? I know the reason why commands like cd can't be executed by forking mechanism but is there any harm if ls is executed without forking?
2
votes
1answer
52 views

Is it bad when dvdisaster says that some sectors of a dvd disc are unreadable?

I wanted to check if an image was successfully written to a DVD, so I checked the checksums: $ sha256sum debian-7.3.0-amd64-DVD-1.iso ...
3
votes
1answer
88 views

How to cd into a directory with the name “-”? [duplicate]

I tried to cd into a directory named - that I created for experimenting. I could not from Bash. How do I cd into it? With Nautilus on Ubuntu 13.10 I could easily do this, and even create files inside ...
4
votes
1answer
258 views

Which 2-letter POSIX command is different from all the others?

I was interviewed for an internship and I got the same question as this one: http://www.glassdoor.com/Interview/Which-2-letter-POSIX-command-is-different-from-all-the-others-QTN_498236.htm The ...
0
votes
1answer
80 views

Can't access the directory /etc/ppp/peers?

I want to read some configuration file. The problem is that I can't move in the folder peers and typing the command ls -l, I see this permission's record: drwxr-s--- root dip ... I never seen that ...
2
votes
2answers
102 views

How do I navigate to a CD drive?

I'm trying to install Virtualbox Guest Additions in Elementary OS. cd doesn't seem to work with cd VBOXADDITIONS_4.2.6_82870. Update: I did what @ivica recommended, and here's what I'm getting: I ...
0
votes
1answer
45 views

Test what cd has done ksh

I'm facing a small issue here. I'm doing : cd $(find . -type d | grep "${4:0:4}.*${4:4:2}.*${4:6:2}") $4 is a data entered from the user. However, if the user doesn't respect the format to enter, ...
4
votes
1answer
129 views

`cd` up the canonical path

Consider: $ pwd /home/user $ ls -l total 3604 lrwxrwxrwx 1 user user 19 Nov 27 12:11 pages -> /var/www/pages/ $ cd pages $ pwd /home/user/pages $ readlink -f . /var/www/pages $ cd .. $ readlink ...
3
votes
1answer
80 views

script to remember dir and always cd to it instead of the root dir

How can write a script to change to a given directory but also remember it so that when you do cd it always changes to that directory ? #!/bin/bash setdir() { cd $1 # remember the directory ...
1
vote
1answer
103 views

Changing the current directory using a script (ksh)

I'm launching my script from echo $PWD ---> /x. I want my script to change my current directory. So my script contains +- this : cd /y exit 0 However, when my script ends, I'm stils in echo $PWD ...
3
votes
1answer
48 views

How to cd open / autocomplete a folder that ends in a specific phrase

I have a folder with subfolders named like this: 1122334 important things 1122335 less important things 1122336 notes 1122337 pictures of kittens etc The numbers at the beginning are date codes. ...
1
vote
1answer
180 views

Make a bootable CD without ISO file but from a CD

I have a Windows XP CD which I want to install on a USB Drive. However my own CD drive is broken. I have a friend's laptop on which Windows 7 is installed (and no idea if it has a CDROM of not). ...
3
votes
0answers
269 views

Gnome-terminal and Zsh: keep current directory on new tab/window

I'm running gnome 3.10.1 on Arch with Zsh. I'm facing that problem that when I create a new tab or window from a terminal window, it resets the current dir to my home dir. I've already tried this: ...
0
votes
2answers
97 views

Full Linux distro under 50 MB for a business card CD

I need a full Linux distribution for a non-profit activist organisation that can fit on a business card CD. If that's not possible, there is a business card DVD option too with up to 400 MB capacity. ...
3
votes
1answer
427 views

gnome-terminal: keep track of directory in new tab

I'm on Arch linux, and when I open a new terminal tab, it always goes to $HOME. How can I make it so that when I open a new tab, it opens the shell in the directory I was in previously?
3
votes
3answers
170 views

How to create a short path?

We have so many useful folders, which are in different path, for our working in Linux. For example : $ cd ~/Documents/Courses/EDX/physics2013/ $ cd ~/Documents/Company/OpenGL/Proj/... $ cd ...
0
votes
0answers
40 views

Write a zsh method the responds to a `cd` command [duplicate]

I'm trying to write a script that will be called when navigating into certain directories. What I'd want is to have a message appear when I enter certain (not every) directories based on what it finds ...
2
votes
3answers
143 views

Simplified navigation in terminal

I know IDEs are the wave of the future, but I always find myself coding in vim in a Linux terminal. Old dog. New tricks. Anyway, navigation becomes challenging when dealing with long package names. ...
6
votes
2answers
807 views

What does “cd &” mean?

I know how to change directory from terminal by typing cd <directory> but here's the scenario. I was using terminal to go on my git repository's folder. glennRepositories ...
3
votes
2answers
77 views

Can I run a command after the user uses Ctrl-C to kill a command?

So at my position we use a shared set of aliases to do builds. Something like... alias 'build'='cd $BUILD_ROOT; m; cp ...; cp...; deploy; deploy; deploy; cd -' This is super irritating because the ...
1
vote
1answer
168 views

Difference between 'cd' and 'cd ~'

I am wondering, if cd alone sends me to my home folder and cd ~ does the same, why was the ~ added in the first place then? Is it something specific to BASH or would they behave differently in ...
42
votes
6answers
2k views

Is there a way to cd back multiple times in bash?

I often use cd - to go back to where I was. How can I do this multiple times in bash? Or would zsh or some other tool support this?
2
votes
3answers
96 views

cp SOMEFILE .. copies to a different directory after cd'ing via a symbolic link

Consider the following setup: ~/Desktop/Public/subdir ~/Desktop/subdir --> ~/Desktop/Public/subdir (symbolic link) Now I do: cd ~/Desktop/subdir Which leads me into the linked directory. If ...
0
votes
1answer
57 views

How do I change working directories with KDialog?

Use-case: I am working in the terminal in /path/with/a/very/long/name and I want to change to some other directory that is deeply nested. But I don't know the path by memory. So I want to browse via a ...
1
vote
3answers
55 views

Rename directory from within directory?

How would I rename a directory from within that directory? For example: ~/tmp $ rn tmp2 ~/tmp2 $ I can do that with: cd .. && mv tmp tmp2 && cd tmp2, but not sure how to make it ...
3
votes
3answers
163 views

Quick access to work directory of background job

Minimal effort to reproduce what I am looking for, is as follows /$ sleep 1h & [1] 6564 /$ cd ~$ jobs [1]+ Running sleep 1h & (wd: /) When I use jobs to manage my ...
1
vote
1answer
47 views

How to autocd in tcsh?

I want to change directory without using cd, I want to access the directory by its name $home/user/tools $cd tools //works fine $tools //permission denied I tried set autocd but still the same?
23
votes
4answers
1k views

How to go to the previous working directory in terminal?

In terminal, how can I define a key to go to the previous directory which I was in when changing directory with the cd command? For example, I'm in /opt/soft/bin and I cd into /etc/squid3 and I want ...
16
votes
4answers
2k views

Why does `cd` command not work via SSH?

I was trying to backup some files via SSH but instead of tar'ing the ones I wanted I got my home folder. I did some further testing and it boils down to this: ssh root@server /bin/sh -c "cd /boot ...
5
votes
2answers
732 views

How can I cd into a directory as root?

Let's say there's a directory that I don't have the privileges to access. Obviously sudo cd foo won't work, because cd is a shell builtin in every shell ever. So far, I've just been using sudo bash ...
3
votes
2answers
159 views

cd to directory of a symbolically linked file

Before I write a script, anyone know an easy way to do the following: $ pwd /foo/bar $ ls -l lrwxr-xr-x 1 username admin 48 Apr 17 2012 foo.sh -> /bar/foo.sh $ cd /bar $ ls foo.sh i.e., in ...
1
vote
2answers
107 views

Launcher for a Python program that requires extra libraries

I'm trying to get a launcher working for the WikidPad (python) program. I already have a python program, so I looked into the file /usr/share/applications/taskcoach.desktop. The exec line was simply ...
6
votes
2answers
5k views

How do I use pushd and popd commands?

What are the practical uses of both pushd and popd when there is an advantage of using these two commands over cd and cd -? EDIT: I'm looking for some practical examples of uses for both of these ...
6
votes
4answers
548 views

How to make `cd dir/filename` take me to dir/?

I would find it very convenient to be able to use cd with a file argument. cd myDirectory/anyname.anyExtension would be equivalent to cd myDirectory/ What would be the best alias or function to ...
2
votes
1answer
112 views

Why does cd default to ~?

When you type cd, it basically does the same thing as cd ~. Why? I'm wondering if it's just a hard-coded behavior or if bash is expanding the command or something.
2
votes
1answer
97 views

cd and ls in the same call [duplicate]

I often have to cd to a directory and ls to see the directory listing. Can it be done with one shot, so that I can add to .bashrc as alias. I searched on Google, there were some answers, but ...