LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there any way to link terminal sessions? (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-any-way-to-link-terminal-sessions-885012/)

FormatC 06-07-2011 10:56 AM

Is there any way to link terminal sessions?
 
I was doing some rather lengthy procedures using a terminal. Then I wrote script using Kate, and input it into that terminal, and then realized that I was logged in as a normal user in that terminal as opposed to a superuser, which is how I was logged in at the other terminal. I've never noticed this before because I've never done anything that takes this long.

Is there any way to link all terminal sessions in such a way that they all show me logged in as the same user? I don't even know if this is even important, but I don't want to risk losing any things that I had done.

ncsuapex 06-07-2011 10:58 AM

you could edit your shells path to show you the current user name. If you're using bash you can edit .bashrc look for the PS1= line.

the "\u@" option shows username

MTK358 06-07-2011 03:31 PM

Quote:

Originally Posted by ncsuapex (Post 4378905)
the "\u@" option shows username

That's extremely unhelpful if FormatC doesn't understand the syntax for PS1 and typical conventions used in prompts.

Bash expands "\u" to the username. Here's how many prompts look like:

Code:

username@hostname:currentdir$
The "@" between the username and hostname is what ncuapex is talking about. It's not necessary and is totally irrelevant if you choose to format your prompt differently.

Here is a great guide on customizing your bash prompt:

https://wiki.archlinux.org/index.php/Color_Bash_Prompt


All times are GMT -5. The time now is 04:32 PM.