Why do shells look different for different users? [closed] - linux

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have a server in which there are 2 users: root and bob while I am logged in as root, everything look normal. Files are colored according to type, I can press up and down to search for previous typed commands, and I can see the current folder name in the shell prompt.
Being logged in as user bob everything seems "weird", nothing is colored, pressing up and down give me weird characters in the command line like "^[[A^[[B" and I can only see the character "$" in the command line prompt.
Is there a way to fix the issue?

Two possible features could be causing this.
The first: your two users could be using different terminals (i.e. bash, busybox, etc.)
You can change this per user in the /etc/passwd file
The second comes down to preferences, typically stored in ~/.profile, ~/.bash_rc and ~/.bash_profile. ("~" refers to the home directory for that user, also found in /etc/passwd file, typically "/home/USERNAME").

Related

Bash prompt display username starting with $ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 months ago.
Improve this question
I have registered some linux machines intro AD with sssd and it works great, but I have an issue with the bash prompt. Some AD usernames start with $ and the prompt refuses to display it, so now I'm left with the string similar to #servername:~$
If I do an export PS1="\$USER#\H" it gets displayed correctly.
Any ideas on how to make bash prompt either escape the special character, or make sssd edit the bashrc with the "correct" format?
This is more of a Linux configuration question and would work better in unix.stackexchange.com or askubuntu, but generally to change default user configuration you'd want to edit the files in /etc/skel.

Current path is not showing in terminal for new CentOS user [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I have created a new user on a CentOS server. I don't know why, but when I connect with this new user the current path is not showing in the terminal. Instead, I can see '-bash-4.2'. What is the meaning of -bash-4.2 and how can I display the current path (such as /home)?
Your current prompt variable ($PS1) contains something like \s-\v\$ which corresponds to the name of the shell and its version. To have the prompt display the current path (along with the trailing $ you currently have), set PS1 with this:
PS1='$PWD\$ '
Using either of \w or \W will produce similar results, except for your home directory.
To keep this setting going forward, you'll want to set that value in your ~/.bashrc file.
See more options in the bash manual under PROMPTING or online at https://www.gnu.org/savannah-checkouts/gnu/bash/manual/html_node/Controlling-the-Prompt.html#Controlling-the-Prompt

Unable to remove file on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm currently connected to a remote computer running on Linux and I have a random directory that arose after running one of my C programs. The directory name is of this form: 'H$'204'blahblah''u$'[]'$'234', very strange.
When I try to remove it via rm dir_name the terminal spits out Illegal variable name. The same behavior arises even when I use the -f flag. Then I attempted to remove it by clicking on the directory in the explorer (on vscode) and I get an error saying Error: ENOENT: no such file or directory.
I'm running this on csh shell if that helps.
Update: Running: rm ./H<tab> worked. Thanks to Jamie Guinan!
The magic word is ls -b. It will display non printable characters in an escaped way, so that you will be able to enter them back.

Is there a script to determine linux user name? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I am looking for some code to get the linux username.. I have come across code to get current username but what I need to get is the username that was used when installing linux..
For example, if im logged in as root user, how can i get the initial username that was used when installing ubuntu?
Better still, Is there a variable that I can put in my script that will search & store install username..
you can use fact, that default uid and gid for first created user is 1000:
grep 1000:1000: /etc/passwd|cut -f1 -d':'
but keep in mind:
when default user was deleted, you get empty string
if it running on non standard configuration, uid, and gid may be different
this is not good practise (see next point)
you ate not considering multi-seat configurations, when station have many users, you should provide user config file, where user can put usernames he wants to processed or do it from command line

Why does my root user have a different shell prompt to other users with the same shell? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
The root user on my CentOS 6 distro has a different shell prompt to other users that I create.
If I
echo $PS1
for root user, I get [\u#\h \W]\$
If I do the same for another user, I get \s-\v\$
If I run
which bash
I can see that both users are using the same shell (/bin/bash/).
Is the $PS1 variable being set differently for individual users or groups somehow?
Usually it sets a different PS1 for root in /etc/profile or /etc/bash.bashrc.
Run echo $SHELLto identify your shell (which bash tells you where Bash is, not whether you're using it).
To clearly tell if you at each and every command line whether you have super-user (root) privileges or not
Yes, it is set different (for users). The PS1 variable is read from the .bashrc of your home directory or /etc/profile or /etc/bash.bashrc.

Resources