• We had to restore from a backup today after a failed software update. Backup was from 0000 EDT and restored it at 0800 EDT so we lost about 8hrs. Today is 07/20/2024. More info here.

Pop_os! terminal started behaving weird.

katsu

New Member
Joined
Sep 25, 2022
Messages
8
Reaction score
3
Credits
72
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 ?
 


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\][\u@\h \w]$ \[\e[0m\]"
To source the .bashrc file, after you've altered the .bashrc file, run:
Code:
source .bashrc
 
Last edited:
Just to add some confusion... ~ means 'home directory'. So this will work:

Code:
cd ~/Downloads
 
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:
@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
 


Top