Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cd-command]

Is for questions about `cd` built-in bash command (e.g. how it works).

14
votes
3answers
2k views

Why doesn't using two cd commands in bash script execute the second command?

I have written a bash script which creates a series of directories and clones a project to selected directories. For that, I need to cd to each directory (project 1 and project 2), but the script ...
0
votes
1answer
37 views

Backslash at start of file path?

When using the cd command at the terminal, I get a 'no such directory' error if I type something like cd /directory/whatever/ But when I type something like cd \directory/whatever/ It works just ...
0
votes
3answers
48 views

Shortcut to `cd` into the 2nd folder in a directory

How to cd into the 2nd folder in a directory? CONTEXT I am in a directory with 3 folders. After executing ls -1 they are ordered like so. folder1 folder2 folder3 I want to quickly cd into ...
2
votes
1answer
44 views

What can mess up the order of the tab completion

I am experiencing a difference of behavior between my previous OS (Ubuntu Xenial) and my current one (Ubuntu Bionic). The short story is this: When using tab completion with cd, the order of the tab ...
0
votes
0answers
28 views

Why my terminal opens a dir without cd today?

I'm on Xubuntu 18.04, and everytime I typed vim in the terminal, It opened vim editor. But today, It opens a directory named vim! what can cause that? I just changed my font size from 14 to 13 ...
3
votes
1answer
117 views

Can not change directory. Completely new at Ubuntu

I am really new at ubuntu and I'm trying to set my directory to a certain file. Whenever I set it to the folder with all my C++ files it says No such file or directory I type in cd /home/ and that ...
8
votes
4answers
2k views

How do I prevent 'cd' command from going to home directory?

The thing is that sometimes I type cd by mistake and that take me to the home directory. e.g. I'm in a directory that have a hidden directory and a visible directory, I quickly press cd+tab and that ...
0
votes
1answer
304 views

How to change directory

When I try to change my working directory to C:\Users\Michell Payano\Desktop\Data Analytics Tools, the result is -bash: cd: too many arguments. I want to know what is wrong.
7
votes
3answers
999 views

Error when using the commands cd.. and cd. in the terminal [duplicate]

I try to use the commands cd.. and cd. in the terminal to move from my current folder to a previous one, and it shows me a message that the command doesn't exist... What could the problem be? I'm ...
0
votes
2answers
234 views

Can I make USB stick with exfat-fuse case sensitive?

I have a USB stick for which I had to install exfat-fuse, and have mirrored my home diectory onto it for backup purposes with rsync. I have a folder called Documents and I notice I cannot cd documents ...
-3
votes
1answer
151 views

Why can't I access this folder?

Why can't I access the folder /website1? juozas@personal:/opt/lampp/htcdocs$ ls website1 juozas@personal:/opt/lampp/htcdocs$ cd /website1 bash: cd: /website1: No such file or directory juozas@...
1
vote
0answers
23 views

What happened when I typed cd // [duplicate]

I accidentally typed cd // instead of cd .. and something weird happened. The directory // doesn't exist, what's going on here exactly. root@root:/var/www/html# cd // root@root://# pwd // root@root://...
-2
votes
1answer
117 views

Why does `//` only display for first level directories? [duplicate]

For the root directory a // will display in the prompt: ─────────────────────────────────────────────────────────────────────────────── rick@alien:~$ cd / ─────────────────────────────────────────────...
1
vote
3answers
69 views

Make array of commands for a script

I have several directories that I need to update, and the steps are the same, except, obviously, that every directory has different names. I'm new to making scripts. Can I make an array with e.g. $...
8
votes
2answers
353 views

Command cd behavior [duplicate]

Since ubuntu 17.10, my scripts don't work the same way they used to do: cd a* would change directory to the first directory beginning with a. Now, I get this error: bash: cd: too many arguments I ...
3
votes
2answers
1k views

How to change into directory owned by root if I have sudo? [duplicate]

I have a deploy user that has sudo privledges. I can't sudo cd into the directory, but I can list it like: sudo ls /root How can I cd into the folder, or is that not possible?
5
votes
1answer
2k views

'Permission denied' when I cd into any folder

Whenever I try cd folder_name/ in bash on any directory it gives this error: -bash: cd: folder_name/: Permission denied Execution permissions are given to all folders so that doesn't seem to be the ...
0
votes
1answer
263 views

Setting CDPATH environment variable

"export CDPATH=/usr", like this I want to manipulate CDPATH environment variable. Then I can't be sure it is the same as before when I put "export CDPATH=." on the command line and enter. So, I want ...
1
vote
1answer
1k views

No such file or directory when I try to cd to a directory with two words in the name [duplicate]

I am trying to untar a file and to do so, I have to go to the directory in terminal. So as in the screenshot above, My downloads are stored in Downloads/Chrome Downloads. But when I type the ...
0
votes
1answer
117 views

cd command is not working

So every time I try to navigate to a directory it gives me this message but when I navigated to my desktops directory it did just that
-3
votes
1answer
11k views

cd command is not functioning in Terminal “desktop: No such file or directory” [duplicate]

I have been trying to access a folder to install a program and I keep receiving the following error message: bash: cd: *: No such file or directory I then tried accessing the desktop with the ...
1
vote
2answers
67 views

How to edit the highest parent directory of a path while navigating

Noob question: Let's say I'm in: user@mj:~/var/www/html/mag/something/else/forever$ And I want to be at: user@mj:/var/www/html/mag/something/else/forever$ Mind the ~ I can achieve that with: ...
2
votes
1answer
3k views

Permission denied from opening directory [duplicate]

I have always wondered how you stop another user from entering a directory. I am in a local installation of GitLab and I see that in my git directory I have a repositories directory. If I try to ls or ...
6
votes
4answers
2k views

How can I have mkdir cd into the newly-created directory? [duplicate]

Frequently, I type these commands in bash: mkdir something cd something I almost never do this: mkdir something ls # something in the current directory, not ./something/ And never this: mkdir ...
0
votes
0answers
357 views

how to install CGAL-4.10?

I've done this: cd ~/src wget https://github.com/CGAL/cgal/archive/releases/CGAL-4.10.tar.gz tar xzf CGAL-4.10.tar.gz but for this: cd CGAL-4.10 I got error: bash: cd: CGAL-4.10: No such file ...
10
votes
4answers
8k views

Ubuntu 17.04 — bash: cd: too many arguments

I just upgraded my Ubuntu 16.04 to 17.04 and found a little problem with cd command. Let's say that I have two folders: album-01 & album-02 In Ubuntu 16.04, if I do cd album* it will go to the ...
1
vote
2answers
1k views

How to run cd as superuser [duplicate]

I want to cd into a directory from the terminal but access is denied, and typing sudo cd (directory) returns an error about sudo not supporting the cd command. I can use sudo gnome-terminal to launch ...
4
votes
3answers
4k views

`cd` not working if used in bash script [duplicate]

I cannot use cd anymore when using it in a bash script [~/Downloads] # cat cd-backward #!/bin/bash cd .. [~/Downloads] # ./cd-backward [~/Downloads] # I should move to ~ at the last line. cd ...
3
votes
1answer
3k views

cd to a symlink, is the same to cd to original folder?

I want to create a symbolic link just for convenience (I don't want a type a long path), so if I do something like: ln -s /foo/bar/baz ~/baz cd baz All commands that I run while I'm in ~/baz will ...
0
votes
2answers
549 views

change directory to USB disk

I can not change to a directory that is placed in an USB disk. But I am able to change to the internal disks directories by using the cd command. When I type df-h to identify the external disk name, ...
0
votes
1answer
121 views

Changing a directory with quotes and spaces.[Linux]

I've been trying to change into this directory all day with no such luck. .\ \ \ \ ug1y\ \ \ ..\ \ \ \ ''\ \ "\ \ \ The backslashes are just blanks because I used the ls -ab command. If someone ...
21
votes
5answers
5k views

Which package is the command 'cd' in?

I want to look into the source code behind the command cd, but cd doesn't seem to have its own package so which package is it in?
1
vote
2answers
248 views

cd - further into history [duplicate]

How could I use something similar to cd -, which goes to the previous directory in history, in order to go back even further in directory history? For instance lets say my history is: (1 being current....
2
votes
2answers
602 views

What does cd — do? I used it and I'm now stuck in a directory :(

I entered cd -- into the terminal, just to see what I'd get... It brought me here: ~ # (I'm root btw). Just wondering where exactly I am - if I enter ls the output is: Desktop ls -a: . ....
1
vote
1answer
795 views

Bash:cd:No such folder or directory , but it exists

I am new in ubuntu and I am doing a project where i should install the charm crypto library in my android device.In the manual file it says that i should create two folders: $BD and $SCRIPTS. I ...
0
votes
2answers
116 views

Is there a way to get the trailing '/' to appear when using cd with a symbolic link directory?

I'm using the bash shell and use lots of soft links. One minor but annoying behavior I observe is the fact that I need to hit tab twice to complete the name of a soft link to a directory. e.g. $ ...
2
votes
2answers
86 views

Start terminal at particular directory

I always need to go at workspace directory using cd, I got bored with this. I want that terminal should be opened at my workspace directory on start, is there any way to do this? Please suggest.
2
votes
3answers
726 views

How can I enter and also rename folders like ''Human (2012)''? [duplicate]

I am playing with FTP via the command line, and I get two problems. I am not able to rename or enter folders like: dir /home/folder1/Human (2012) I tried: cd ~/folder1/Human\ (2012) Here I receive ...
0
votes
1answer
335 views

changing directory in bash script file [duplicate]

I've spent to much time in the DOS world where cd.. (no space) works. I tried to do the same in ubuntu by defining a bash file in /usr/local /bin called "cl.." its body is #!/bin/bash cd .. I ...
8
votes
9answers
4k views

How can I cd to a directory without writing its name?

Sometimes it’s annoying to access a directory with the folder name. Say I have a directory named a b c d. Apart from using Tab, is there any way to access the folder without typing the name of the ...
4
votes
1answer
7k views

Terminal doesn't go to /home/username/downloads [duplicate]

When I type cd /home, terminal goes there but when I type cd /home/myusername/downloads (or any address) terminal doesn't go there. It says no such file or directory. Can somebody tell me what ...
1
vote
3answers
381 views

Changing directory [duplicate]

~$ cd downloads bash: cd: downloads: No such file or directory ~$ ls Desktop Downloads Music Public Videos Documents examples.desktop Pictures Templates ~$ cd downloads bash: cd: ...
5
votes
2answers
9k views

Run sudo command within directory

Possible solutions could be: Starting interactive session. sudo -s <<< "cd dir ; command" or sudo /bin/bash -c "cd dir ; command" But I don't have /bin/bash /bin/sh /bin/su or other ...
0
votes
1answer
3k views

No such file or directory when I type “cd desktop” [duplicate]

I'm new to Ubuntu. I'm running Ubuntu 14.04.1 LTS. My problem is that when I try to access my desktop or any folder at my home directory, it always gives me this error No such file or directory ...
1
vote
1answer
107 views

Why ssh shows Desktop folder as a file?

I am using ssh to accessing a server and I could use scp to copy some files to server Desktop by: scp T.tar.gz username@serverIP:/home/username/Desktop but now I cannot access to server Desktop ...
-2
votes
1answer
1k views

bash: cd: desktop/android: No such file or directory [duplicate]

I am trying to flash 4.4.3 to my Nexus 5. When I enter this cd desktop/android I get this: bash: cd: desktop/android: No such file or directory I am looking right at the folder on my desktop ...
0
votes
1answer
93 views

How can I 'cd' into directory from folder in desktop gui view?

Is there a way to open up a terminal from a folder location in a desktop folder? This functionality would be the same as 'cdto' in OS X: https://github.com/jbtule/cdto/releases/tag/2_6_0
2
votes
1answer
126 views

Shell script to function on subfolders

I want to write a simple shell script that will go into all the sub-folders in a directory, and organise the files in the sub-folders into new directories. Basically in terminal it would look like: ...
0
votes
1answer
5k views

cd: /Home: No such file or directory [duplicate]

I saw loads of posts with similar issues; I've looked at the solutions with no luck so far. I use Ubuntu 12.04 LTS Desktop, installed in partition sda5, mounted as /. The main part of the disk is ...
1
vote
3answers
363 views

sudo cannot do cd [duplicate]

I found the strangest thing sudo cd $pwd sudo: cd: command not found I am able to cd as a normal user.It seems that PATH is not set properly for su. How do I fix that?