• We did not send an email asking for donations - please read this post.

Pop_os! terminal started behaving weird.

katsu

New Member
Joined
Sep 25, 2022
Messages
6
Reaction score
2
Credits
52
1664139787165.png


I can't use cd command normally, and I dunno why. Does somebody know what is wrong with it ? why I cant open folders from some other folders but only from absolute start ?
 


osprey

Active Member
Joined
Apr 15, 2022
Messages
244
Reaction score
142
Credits
2,235
There doesn't appear to be any problems with the output you have shown.
There is usually no /Downloads directory. "/Downloads" would mean that Downloads is in the root directory, which it usually isn't, but rather is found in the home directory as you found at: /home/katsu/Downloads.

Similarly, "/katsu" would mean that the directory katsu would be in the root directory, but as you correctly found, is in the /home directory. The error you appear to have made is to unnecessarily access the root directory by the use of the initial / in your cd commands.

To see what directories reside in the root directory, run:
Code:
ls /
and to see what directories are in the home directory run:
Code:
ls /home/katsu

If you want your prompt to show which directory you are in rather than just denoting "@pop-os", you could add this code to the very end of your .bashrc, and source the .bashrc file to give it immediate effect:
Code:
PS1="\[\e[32;1m\][\[email protected]\h \w]$ \[\e[0m\]"
To source the .bashrc file, after you've altered the .bashrc file, run:
Code:
source .bashrc
 
Last edited:

JasKinasis

Well-Known Member
Joined
Apr 25, 2017
Messages
1,563
Reaction score
2,224
Credits
11,524
Just to add some confusion... ~ means 'home directory'. So this will work:

Code:
cd ~/Downloads

@katsu :
Also, if you’re already in your home directory, you could just use:
Bash:
cd Downloads

Or, if you wanted to be explicit, you could use a relative path:
Bash:
cd ./Downloads
In the above example ./ denotes the current directory.

And although my first example doesn’t have a ./ in the path, the ./ is implicit.
So both are pretty much exactly the same thing. They cause cd to enter the Downloads sub-directory of the directory we’re currently in. (If one exists in the current directory - otherwise you’ll quite rightly get an error message!)
 
Last edited:
OP
katsu

katsu

New Member
Joined
Sep 25, 2022
Messages
6
Reaction score
2
Credits
52
@katsu :
Also, if you’re already in your home directory, you could just use:
Bash:
cd Downloads

Or, if you wanted to be explicit, you could use a relative path:
Bash:
cd ./Downloads
In the above example ./ denotes the current directory.

And although my first example doesn’t have a ./ in the path, the ./ is implicit.
So both are pretty much exactly the same thing. They cause cd to enter the Downloads sub-directory of the directory we’re currently in. (If one exists in the current directory - otherwise you’ll quite rightly get an error message!)
Yeah, thank you, I consider this as the best solution for my problem which I had :D
 
$100 Digital Ocean Credit
Get a free VM to test out Linux!

Linux.org Hosting Donations
Consider making a donation

Staff online

Members online


Top