-
When I use text console by CTRL+ALT+F3 and log in under my user, I can’t use any commands. For example:
ls
produces command not found
, and so on.
-
When I log in under root
user - everything works as expected.
-
When I do sudo su myuser
and change the user ty my one from root
- works as expected.
I checked PATH
and it’s the same for cases 1) and 3), so I guess it’s not the issue with the PATH
.
Probably there is a permissions issue, but how can I check it?
You have another post where you mention you can’t login … That and this one leads me to speculate you have ownership issues on files and folders in your home directory. Please fix that first.
sudo chown $USER:$USER $HOME
Reboot your system just in case.
After @anon89812132 suggestion:
Have you made any recent changes to .bashrc
or .profile
for USER or related system files?
Try:
- Re-source (
. .bashrc
or source .bashrc
) those files and see if there are any errors
echo "${PATH//:/$'\n'}"
type -a ls
- use the full path from the above output
/bin/ls -l
@anon89812132 before and after changing the ownership, I see the same picture:
ls -la /home
drwxr-xr-x 5 root root lost+found
drwxr----- 40 myuser myuser myuser
...
After reboot, it still doesn’t work.
@stargazer before I got all these issues, I installed oh-my-zsh, but I’ve been working for 2 more days after it.
When I do source /home/myuser/.bashrc
, when I logged in under my user in text console, I get:
zsh: command not found uname
zsh: command not found shopt
zsh: command not found complete
/usr/share/bash-completion/bash_completion:1567: parse error near `|`
/home/myuser/.bashrc:type:66: bad option -P
I don’t know how you set your bash or zsh, or if you mixed something related to them. Make sure if you use zsh that you do this:
cp /etc/skel/.zshrc ~/
chsh -s /bin/zsh
And reboot to make sure.
If you use bash, then either you fix the typo in your .bashrc at line 66, or you do:
cp /etc/skel/.bashrc ~/
chsh -s /bin/bash
…
1 Like
The .bashrc
is the default one, installed with Manjaro KDE, I didn’t change it and it works well when I do sudo su myuser
from root
account.
So, I tried to change my default shell, just by running chsh -s /bin/sh
and now it works!!! All the commands are now available, with syntax highlighting (as it was by default).
Moreover, I can now log in without errors to my profile (Login screen freezes after entering login/password, but works for root user)
Seems like zsh
somehow breaks the system, but I can’t figure out how and in which way
I have never done that in my life, never had to do it.
Don’t know the end of it. Might test it one day.
I’ve never used this syntax either 
Does it make any difference if you use, sudo su - myuser
or sudo su --login myuser
or sudo -i -u myuser
.
Notice these are going to create a login shell, thus read the specific login files.
What’s the output of chsh -l
.