Bash prompt display username starting with $ [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 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.

Related

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

Why does the default shell in OS X 10 look differently than that in Linux (Mint, Lubuntu...)? [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 6 years ago.
Improve this question
To clarify, when entering the default shell in OS X it appears as:
pcname:~ username$
and changing directories appears as:
pcname:myFolder~ username$
however, in my experience with linux distros, the shell appears as:
username#pcname:~$
what is the purpose for the differences in syntax?
What I do is the following: On the system that has the promt the way I want it, I type:
echo $PS1
I copy the result, say, \u#\h \w\a \$ and then edit the ~/.bashrc on the system that I want to use with the line:
export PS1="\u#\h \w\a \$ "
And then I get the same prompt on that system as well.
If you want to get creative, have a look here

linux - adding a 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 6 years ago.
Improve this question
I have this code but it is not compiling correctly. I want to create a user with a default shell of bin/sh with the group adults. Any suggestions?
Command: useradd -s /bin/sh –g adults michael
Thank you.
First of all the code given is not being compiled, but rather executed by a shell. Then your command is perfectly fine, given that the adults group already exists before you type the command into your shell.
So without error, or more context, nobody will be able to tell you more than what I'm telling you:
there's no issue with your command.

How to log terminal keystrokes in ubuntu [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 8 years ago.
Improve this question
I want to log whatever is happening in my terminal in a text file . I want to save all session information in the log file. We can do this in putty. But I dont know how to achieve the same in simple terminal in ubuntu. Also, is it possible to use putty to open a terminal for localhost? I tried doing that . But does not work.
You can record your terminal session (assuming you're using Bash) by doing script.
You probably want script -k which records input and output.
So in all, doing something like script -k logfilename you will get what you want!

Hashtag instead of the dollar sign ssh 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 8 years ago.
Improve this question
Hello I got a server with Centos 5 (64 bits) installed and when I'm connecting with putty after entering the user root and the password I get a hashtag instead of a dollar sign I'm confuse.
[root#mokmeuh ~]#
Also it's seems that alot of command don't work like
[root#mokmeuh ~]# $chmod u+x file.sh
That's just one but I can't run a shell script or anything like that so I'm confuse and need some help.
Yep, hashtag usually says that you're root.
Normal users have the dollar sign.
But you shouldn't write the dollar sign in front of your commands. Just leave it.

Resources