LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-04-2019, 04:24 AM   #1
whois1230
Member
 
Registered: Sep 2018
Posts: 214

Rep: Reputation: Disabled
Change directory not working


Code:
user@debian:~$ cd
user@debian:~$ cd /home/user
user@debian:~$ cd
user@debian:~$
Hello, I can't change directory, because the command is not working
 
Old 03-04-2019, 04:36 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
~ is a short cut for your home directory and you can see the current working directory by running the command pwd.

Running the cd command without a path puts you in your home directory therefore the commands work since you are already in your home directory. Try

cd /tmp
cd

Last edited by michaelk; 03-04-2019 at 04:38 AM.
 
1 members found this post helpful.
Old 03-04-2019, 04:42 AM   #3
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Also try the pwd command occasionally. It tells you the current directory.

By the way, there is no guarantee that the current directory is shown in your shell prompt. Though it is common practice to include it in the prompt, you can easily configure this differently.

Last edited by berndbausch; 03-04-2019 at 04:44 AM.
 
1 members found this post helpful.
Old 03-04-2019, 05:58 AM   #4
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
You can set your prompt to display pwd; simply add following to ~/.bashrc file:

Code:
PS1='[\u@\h \w ] \$ '
Here \u will show username
\h for hostname
\w for working directory

So, let's say if I am in my home directory, Downloads/tmp directory, this is what it will show:

Quote:
[username@hostname ~/Downloads/tmp ] $
There are many more options, here is list:
https://ss64.com/bash/syntax-prompt.html
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How do I change change the home directory to be owned by me and not root? Slackware theif519 Linux - Newbie 4 06-24-2011 12:21 PM
chroot:cannot change root directory to: No such file directory janakiramulu Linux From Scratch 5 04-23-2011 01:00 AM
ProFTPd can't change directory "no such file or directory" mpmackenna Linux - Server 2 05-04-2010 03:52 PM
change default vsftp anonymous accout directory /var/ftp to other directory? hocheetiong Linux - Newbie 2 01-24-2010 06:33 PM
UK Finance Directory,Online Finance Directory,UK Finance,Finance Directory in UK seekuk General 1 12-30-2005 04:04 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 05:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration