Questions tagged [cd-command]

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

Filter by
Sorted by
Tagged with
0
votes
1answer
86 views

BASH: Given a partial directory name … how to cd into that directory

Having trouble with a bash script. I need to cd into a directory using a partial name such as binutil where the full directory name might be binutil-2.36. I need to do this so that as each package ...
0
votes
1answer
51 views

How do I stop cd command from printing absolute path everytime?

I edited my .bashrc to add more directories to $CDPATH. It looks like this: export CDPATH=".:~:~/LEI/2_ano/2_smt:~/LEI/2_ano/1_smt" But now every time I use the cd command, it prints the ...
0
votes
2answers
47 views

Folder navigation - VLC folder

Hi im a fairy new linux user Im trying to navigate to the lua folder in vlc. When i type whereis vlc It said: vlc: /usr/bin/vlc /usr/lib/x86_64-linux-gnu/vlc /usr/share/vlc /snap/bin/vlc /usr/share/...
0
votes
0answers
46 views

`cd ..` command takes me to the Trash directory

I was surprised when this happened and am trying to understand under what circumstances this is possible. I am using Ubuntu 20.04.
0
votes
0answers
528 views

cd /media/[user]/[external hdd]: Permission denied

I don't have permission to cd into my own external hard drive. sudo cd is not a syntactically legal command (tried it). What is going on?
1
vote
1answer
108 views

Why does the current directory not change after executing script? [duplicate]

A script is executed from the shell as ./oximeter. The script, oximeter, has 5 commands: python3 ~/Documents/oximeter/3211ipod.py ls -l pwd cd ~/Documents/oximeter/ pwd The python script runs as ...
1
vote
1answer
49 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
2k 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
4k 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
106 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
131 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
2answers
48 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
1k 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
469 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
89 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
831 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 ...
3
votes
3answers
17k 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
65 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
-1
votes
3answers
7k 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
38 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
3k 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
854 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
322 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
74 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
2k 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 ...
11
votes
4answers
4k 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
1k 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
165 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
29 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
129 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
464 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
475 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
615 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
3k 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
251 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
49k 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
80 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
5k 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 ...
11
votes
4answers
17k 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
10k 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
6k 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
2k 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
424 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 ...