Skip to main content

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
1 answer
37 views

External Hard drive mount, and Make directory [duplicate]

cloud@cloud-System-Product-Name:~$ cd /media/ cloud@cloud-System-Product-Name:/media$ ls cloud cloud@cloud-System-Product-Name:/media$ cd /media/cloud/ cloud@cloud-System-Product-Name:/media/...
Lets Tank's user avatar
-1 votes
1 answer
206 views

How do I use CDPATH to cd to Documents no matter which directory I am in?

If the cd shell builtin doesn't see the target directory in the current directory, it consults CDPATH. If the target directory is absolute (begins with the root directory, /), CDPATH is not used. ...
Guilherme Woolley's user avatar
1 vote
1 answer
84 views

Help command documentation explanation

Running help cd gives: The variable CDPATH defines the search path for the directory containing DIR. Alternative directory names in CDPATH are separated by a colon (:). A null directory name is the ...
Guilherme Woolley's user avatar
0 votes
0 answers
353 views

cd color highlighting

I am using Ubuntu in WSL2 and there is some annoying highlighting of folders. I managed to solve the highlighting when using ls via this tutorial: https://blog.jongallant.com/2020/06/wsl-ls-folder-...
samokosik's user avatar
0 votes
3 answers
308 views

Can't cd to path variable in simple bash script

I checked similar questions and tried the answers given, no luck there. I'm using WSL and trying to do what ought to be simple. Take a windows path and format it, letting me cd to that directory with ...
Patrik G's user avatar
0 votes
0 answers
107 views

Cannot change working directory in Ubuntu using cd

I'm fairly new to working in Linux so bear with me. I want to run some 16S sequencing data through QIIME2, so I installed Ubuntu on my computer (Windows 11) along with the WSL. I managed to get ...
Faith B's user avatar
0 votes
0 answers
45 views

How to change directories in a shell script? [duplicate]

Background I'm currently using the CLI for md-to-pdf. I'm not sure if it's by design or limitation, but when generating PDFs from MD files containing PNG hyperlinks from not within the directory ...
nlecce's user avatar
  • 1
0 votes
0 answers
108 views

No such file or directory using thunar

This is really frustrating. Ubuntu Mate 18.04 The directory exists. df Filesystem 1K-blocks Used Available Use% Mounted on udev 3492940 0 3492940 0% /dev tmpfs ...
fixit7's user avatar
  • 3,189
8 votes
4 answers
11k views

cd command in terminal takes too long time to execute

When I try to navigate directories using the cd command, it takes way too a long time. And terminal suggests creating a config file to increase the timeout. Once my terminal hanged, I mean when I ...
Nishant Kumar's user avatar
3 votes
1 answer
5k views

Cannot cd into directory even though group has permissions

I'm aware that there are other similar questions, but nothing in there solved my issue. gitlab-runner@my-machine:~$ groups gitlab-runner my-user gitlab-runner@my-machine:~$ sudo ls -l /home total 16 ...
theberzi's user avatar
  • 161
2 votes
1 answer
2k views

How to "cd $variable" when the variable tries to add "\" before spaces (path contain spaces)?

My bash script registers its own path so it can return to its own folder after doing a cd somewhere (kinda if it explores a different forest and is able to relocate its house). And if the path have ...
Daniella Mesquita's user avatar
0 votes
0 answers
514 views

Mount drive and cd into a folder

I have my work files on a different drive. Every time I want to work on it, I have to click through files -> Other locations -> /dev/sda2. Then run the terminal in there. I am wondering if this ...
llssff's user avatar
  • 1
0 votes
2 answers
530 views

cd with variable not working [duplicate]

I am trying to assign a directory name to a variable and use that variable to create and change the directory. dir_name='tmp' mkdir $dir_name cd $dir_name How to change directory?
user1464294's user avatar
0 votes
0 answers
388 views

Using tar command to backup file

I am using a live cd to take backup of a file.This was my problem. Now I want to use tar to backup a single file Phone academics where I have accumulated other files and I want to create the backup in ...
Spectra's user avatar
  • 211
0 votes
1 answer
606 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 ...
keith bradley's user avatar
1 vote
1 answer
1k 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 ...
Daniel Oscar's user avatar
-1 votes
2 answers
286 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/...
Powermongur's user avatar
1 vote
1 answer
415 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.
Confusion Matrix's user avatar
1 vote
0 answers
2k 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?
Michael Starr's user avatar
1 vote
1 answer
493 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 ...
gatorback's user avatar
  • 6,017
-1 votes
1 answer
780 views

How to create a new directory and switch into it from the command line? [closed]

Using the command line, how can I create new directory and navigate into it? For example, I would like to create a new directory named CSIS536 under my home directory, and change to the directory.
Lorraine Holmes's user avatar
1 vote
1 answer
68 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 ...
Phlip's user avatar
  • 11
0 votes
1 answer
6k 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 ...
Peter's user avatar
  • 103
-1 votes
1 answer
10k 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 "...
IntrovertSavage's user avatar
2 votes
0 answers
306 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 ...
Hans van Leeuween's user avatar
3 votes
2 answers
710 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 ...
BlankNo's user avatar
  • 33
0 votes
2 answers
72 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 ...
No No's user avatar
  • 3
0 votes
1 answer
2k 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 ...
Mani Vannan's user avatar
0 votes
2 answers
2k 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 ...
Zer01ne's user avatar
0 votes
1 answer
274 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: ...
raine c's user avatar
  • 11
4 votes
2 answers
2k 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 ...
freebird54's user avatar
4 votes
3 answers
52k 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?
Malicious's user avatar
4 votes
2 answers
79 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
Jacob Kopczynski's user avatar
0 votes
3 answers
25k 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, ...
J. Denver's user avatar
0 votes
1 answer
65 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 ...
tatsu's user avatar
  • 3,267
15 votes
3 answers
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 ...
Jenny's user avatar
  • 591
0 votes
1 answer
2k 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 ...
Inglorion's user avatar
0 votes
3 answers
872 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 ...
Conor Cosnett's user avatar
2 votes
1 answer
123 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 ...
DannyB's user avatar
  • 135
0 votes
0 answers
46 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 ...
amirali's user avatar
  • 101
3 votes
1 answer
6k 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 ...
Alex's user avatar
  • 31
12 votes
4 answers
6k 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 ...
vinicius de novaes's user avatar
0 votes
1 answer
3k 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.
Michell Payano's user avatar
8 votes
3 answers
4k 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 ...
dsmastrodomenic's user avatar
0 votes
2 answers
2k 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 ...
B.Tanner's user avatar
  • 2,655
-3 votes
1 answer
304 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@...
Juozas G's user avatar
1 vote
0 answers
33 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://...
Parto's user avatar
  • 15.5k
-2 votes
1 answer
162 views

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

For the root directory a // will display in the prompt: ─────────────────────────────────────────────────────────────────────────────── rick@alien:~$ cd / ─────────────────────────────────────────────...
WinEunuuchs2Unix's user avatar
5 votes
3 answers
4k 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. $...
Maurice Le Olavarriet's user avatar
8 votes
2 answers
624 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 ...
Aurelien's user avatar
  • 168