LinuxQuestions.org
Review your favorite Linux distribution.
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: 72

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: 18,328

Rep: Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597Reputation: 2597
~ 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
Senior Member
 
Registered: Nov 2013
Location: Tokyo
Distribution: Redhat/Centos, Ubuntu, Raspbian, Fedora, Alpine, Cirros, OpenSuse/SLES
Posts: 2,847

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
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
Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS 6-7; SuSE 8-12
Posts: 316

Rep: Reputation: 73
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:29 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration