Questions tagged [cd-command]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
41 views

New to Ubuntu Desktop for windows

I have done several searches to determine how to change to my C drive in windows when using Ubuntu Desktop for Windows. Can someone point me to a manual or tutorial where I can learn how to navigate ...
0
votes
1answer
177 views

I need to cd into directory with spaces `-bash: cd: too many arguments`

The error code is -bash: cd: too many arguments. I am currently using Windows Subsystem running ubuntu 16.04 I tried using a backslash('\') and then the space(' ') , but it is still throwing me the ...
0
votes
1answer
478 views

Directory locations when using WSL

I'm new to the Ubuntu world and I need some help. (Windows 10, Ubuntu 18.04 LTS, x64 system type) I created a directory called "Submarine" using this : mkdir Submarine I want the directory "...
2
votes
0answers
47 views

Change directory problem in ksh

I work with Ubuntu 18.04.3 My current directory is /home/hans/bin, The directory /home/hans/.sshz also exist. My shell is "ksh." The command cd ../.ssh give the output. ksh cd: /home/hans/ssh:[No ...
2
votes
2answers
81 views

Why doesn't system() work when called in a loop with cd and rm commands?

I started using Linux recently, so my program is just for learning. Having said that, here's my code: #include <stdio.h> #include <stdlib.h> int main () { FILE *fin; char buf[200]; fin ...
0
votes
0answers
27 views

Why path to a directory is not appearing with green color?

I'm using ubuntu. I mistakenly deleted some files after that @Desktop appears with black color not with green one.How to fix this problem?I want it to be green one. Moreover I'm also getting ./main: ...
0
votes
2answers
45 views

giving the command in the directory where the file is located [duplicate]

Stupid question time! I've been toying around with Ubuntu for a couple hours and most of the programs I need are working just fine, but now I'm not sure how to install something. [...] giving the ...
0
votes
1answer
401 views

Home no such file or folder in terminal

I'm trying to go to Downloads directory, the dir is showing in the list but not able to open it in terminal. ajl1254@ajl1254:/home$ ls ~/ Desktop Downloads Music Public Templates ...
0
votes
2answers
100 views

File / Folder navigation problem with the 'cd' command [duplicate]

I used to use this command cd /Foldername to navigate the folder. But I am facing a problem with this now I need to use this command cd ~/foldername for navigating. Please have a look on the screen ...
0
votes
1answer
53 views

cd-command not operating even with capitalized letters used in bash

Hey everyone I need help with my cd command as it is not working. I typed: cd Downloads and it won't work, I'm trying to install something and it's giving me this as a response. -bash: cd: ...
4
votes
2answers
311 views

Can't cd to a (passed) variable in bash script

I am using bash to get some information from audacious to conky for display (including album art). I get the path to the directory of the music file from audacious, then attempt to cd to that ...
2
votes
3answers
6k views

-bash: cd: Desktop: No such file or directory

I'm trying to type: cd Desktop from the /root directory, but when I do it comes up with the error: -bash: cd: Desktop: No such file or directory What am I doing wrong?
4
votes
2answers
62 views

Examine a folder named `-F/` [duplicate]

I think this folder was probably created by accident at some point, but I can't ls or cd to it to check. Things I have tried: ls '-F' ls "-F" ls \-F ls \\\-F ls \\-F and the cd equivalents
-2
votes
3answers
2k views

How to elevate privileges to root in bash and return back?

How to elevate privileges to root in bash? And then how to return back to exactly the previous state? My question is both about elevating/decreasing privileges and possible troubles with some apps, ...
0
votes
1answer
37 views

If you cd to a different user's home and run an apt install command does that do anything special?

If you cd to a different user's home and run an apt install command does that do anything special? I know, I know, this sounds dumb. My base instinct is to say : "No, obviously!" but then I saw ...
15
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
359 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
230 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
68 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
38 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
1k 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 ...
10
votes
4answers
3k 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
2k 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.
8
votes
3answers
2k 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
704 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
162 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
28 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
124 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
107 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
446 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 ...
4
votes
2answers
3k 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
4k 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 ...
1
vote
1answer
483 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
2k 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
203 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
33k 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
77 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
5k 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 ...
9
votes
4answers
4k 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 ...
10
votes
4answers
14k 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
3k 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
6k 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 ...
4
votes
1answer
5k 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
1k 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
345 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 ...
22
votes
5answers
5k views

Which package is the command 'cd' in? [duplicate]

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
356 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....
3
votes
2answers
2k 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
1k 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
123 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. $ ...