Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

  1. #1
    Join Date
    Feb 2015
    Location
    Chico, California
    Posts
    51

    Default New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Hi, (note, I talk a little about other distros, but I'm mainly here for openSUSE)

    I've used mainly Microsoft DOS and Windows since about 1987. I decided to give Linux a go by running it in a Virtual Machine (using Oracle's Virtualbox). I tried Linux back in 2007 but gave up on it because I didn't understand it compared to Microsoft Windows and the MS command prompt. But now in 2015 I'm ready to try it again because of all the free programs I can get, that to me makes it attractive. Free is good! And to see what it's capable of and what I can do with it. Not because I'm tired of Microsoft Windows or anything, but mainly to learn Linux and its benefits. And just in this past week, I'm starting to see the light when it comes to Linux. I've tried all kinds of distros in the last week to find the ones I like. I like 4 distros, openSUSE, Ubuntu, Fedora, and openMandriva. I have to say, I like openSUSE the best. The others are good too, but openSUSE I like the most. openSUSE and Ubuntu are the only ones I'm able to setup shared folders with between my Microsoft Windows 8.1 host and Linux clients. I figured out how to install Virtualbox's Guest Additions (as you may know, Guest Additions are extra drivers and stuff for Linux) on the Linux clients from within the Linux client. When Guest Additions install, an account group is created on the Linux client called "vboxsf" (for Virtualbox Shared Folders). I couldn't figure out how to get the host and the clients sharing folders until I found this terminal command on a site that someone posted:

    mkdir myshare
    sudo mount -t vboxsf ShareFolder ~/myshare/

    Thats CShareFolder (on my Microsoft Window's host drive C and "myshare" in my home directory in the Linux client. The terminal command above works for openSUSE and Ubuntu but not for Fedora and openMandriva. I Don't know why, but thats okay because I'm sticking with openSUSE anyways. As long as openSUSE allows me to pass stuff between the host and client using shared folders instead of making an ISO and mounting I'm good. But that's not the main reason I chose openSUSE, its just simply that I like it. I'm gonna leave the other 3 Linux distro clients in Virtualbox just to see the difference between them as I learn Linux. That way I can see what makes them common to Linux, and what makes them different by distributor. Since I'm more or less from a Microsoft Windows background, I like the KDE environment more than GNOME because it has a more familiar taskbar at the bottom like MS Windows. Okay enough background (sorry if its overkill). I have mainly 3 questions:

    Question 1: What I wanted to know, is how do I go about making myself a part of the "vboxsf" group graphically (using the GUI instead of terminal). Now that I know how to do it with the terminal, I also want to know how I can do it from within the GUI itself.

    Question 2: As you may know, in a MS command prompt (terminal), if you type the command "prompt $p$g" it makes the command prompt look like "C>" Between the 4 distros, heres what my terminal prompts look like,

    Fedora: [user@localhost ~]$


    openMandriva: [user@localhost ~]$


    Ubuntu Unity: user@localhost ~$


    openSUSE: user@linux-infq:~>

    As you can see, Fedora and openMandriva are the same. Ubuntu is the same too, but without the brackets []. I've learned that the $ sign is an indicator that your not a root user, and the # indicates that you are. I noticed that the openSUSE prompt, like Ubuntu, doesn't have brackets [] either, but what I don't understand is why it doesn't say @localhost instead of @linux-infq like the other 3 prompts. I understand that localhost is my computer, just like MS Windows 127.0.0.1 Since the openSUSE prompt doesn't say @localhost, is @linux-infq still the localhost or pointing somewhere else? I'm sure it means local. What does the "linux-infq" stand for? Linux Information Que I assume? Is it just unique to openSUSE doing it this way, instead of @localhost which I see is more common between distros. As you can see for a Linux newbie, I'm gonna learn more by studying distro differences so that I can see the common of Linux. How do I change the style or characters that make up the terminal prompt in Linux? Why does Fedora and openMandriva use brackets [] and not openSUSE? Or are the brackets merely for taste in prompt style (look). I noticed that instead of openSUSE using the $ sign for none root, it uses the > instead.

    Question 3: How do I change the host name of my computer in openSUSE (not concerned how to do it in the other distros just for openSUSE, my chosen distro). How do I do it with the terminal and GUI?

    Thanks for any help!

    Secret68...

  2. #2
    Join Date
    Feb 2015
    Location
    Chico, California
    Posts
    51

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Sorry about the emoticon faces that appear in my previous post. I don't know why they appeared in my post because I didn't use them. They appear to have replaced the characters I typed out from my keyboard. "C>" testing again... It appears to put a face instead of the colon I typed.

  3. #3
    Join Date
    Aug 2008
    Location
    San Francisco
    Posts
    403

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Quote Originally Posted by Secret68 View Post
    Sorry about the emoticon faces that appear in my previous post. I don't know why they appeared in my post because I didn't use them. They appear to have replaced the characters I typed out from my keyboard. "C:\>" testing again... It appears to put a face instead of the colon I typed.
    Below the message text box, under Additional Options -> Miscellaneous Options:, put a check next to "Disable smilies in text" and you get C:\>

    Howard

  4. #4
    Join Date
    Feb 2015
    Location
    Chico, California
    Posts
    51

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Quote Originally Posted by crmrhm View Post
    Below the message text box, under Additional Options -> Miscellaneous Options:, put a check next to "Disable smilies in text" and you get C>

    Howard
    Ahh, see it! Thanks, it will help in future posts!

  5. #5
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,757

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Quote Originally Posted by Secret68 View Post
    Sorry about the emoticon faces that appear in my previous post. I don't know why they appeared in my post because I didn't use them. They appear to have replaced the characters I typed out from my keyboard. "C>" testing again... It appears to put a face instead of the colon I typed.
    A feature that you, being new here, will not have found until now.


    Can you please use CODE tags around copied/pasted computer text in a post. It is the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.
    Henk van Velden

  6. #6

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Quote Originally Posted by Secret68 View Post
    Question 1: What I wanted to know, is how do I go about making myself a part of the "vboxsf" group graphically (using the GUI instead of terminal). Now that I know how to do it with the terminal, I also want to know how I can do it from within the GUI itself.
    YaST->Security and Users->User and Group Management.

    Question 2: As you may know, in a MS command prompt (terminal), if you type the command "prompt $p$g" it makes the command prompt look like "C>" Between the 4 distros, heres what my terminal prompts look like,

    Fedora: [user@localhost ~]$


    openMandriva: [user@localhost ~]$


    Ubuntu Unity: user@localhost ~$


    openSUSE: user@linux-infq:~>

    As you can see, Fedora and openMandriva are the same. Ubuntu is the same too, but without the brackets []. I've learned that the $ sign is an indicator that your not a root user, and the # indicates that you are. I noticed that the openSUSE prompt, like Ubuntu, doesn't have brackets [] either, but what I don't understand is why it doesn't say @localhost instead of @linux-infq like the other 3 prompts. I understand that localhost is my computer, just like MS Windows 127.0.0.1 Since the openSUSE prompt doesn't say @localhost, is @linux-infq still the localhost or pointing somewhere else? I'm sure it means local. What does the "linux-infq" stand for? Linux Information Que I assume? Is it just unique to openSUSE doing it this way, instead of @localhost which I see is more common between distros. As you can see for a Linux newbie, I'm gonna learn more by studying distro differences so that I can see the common of Linux. How do I change the style or characters that make up the terminal prompt in Linux? Why does Fedora and openMandriva use brackets [] and not openSUSE? Or are the brackets merely for taste in prompt style (look). I noticed that instead of openSUSE using the $ sign for none root, it uses the > instead.
    "linux-infq" is your hostname. The default prompt is set to "user@hostname:currentdirectory> " in openSUSE by default.
    And the "$" does _not_ mean that you are not root. It is just the standard shell prompt if you (or the distro) doesn't change it (actually bash's default is "bash-4.2$ ").
    So in the end, this is just something set up by the distributions. And not all of those distributions you mention use the same shell by default (openSUSE uses bash, Ubuntu uses dash, I don't know about the others)

    You are right though that on openSUSE the root prompt shows "#" instead of the normal ">", to indicate that you are root now.
    But this is not necessarily the case.

    You can change the prompt to whatever you like by setting the variable "PS1" to some value, e.g.:
    Code:
    PS1="Hello master! What can I do for you? "
    Similar to MS ("prompt $p$g"), you can use environment variables as well, e.g.:
    [code]PS1="$USER> "[code]
    or, what would be the same as your "prompt $p$g" example:
    Code:
    PS1="$CWD> "
    or
    PS1="\w>"
    Question 3: How do I change the host name of my computer in openSUSE (not concerned how to do it in the other distros just for openSUSE, my chosen distro). How do I do it with the terminal and GUI?
    YaST->Network Devices->Network Settings->Hostname/DNS.

    You can change it in the terminal with the "hostname" command, see "man hostname".
    Last edited by wolfi323; 27-Feb-2015 at 04:02.

  7. #7

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Hi,

    AFAIK if you are root in bash then you will get the # in the prompt regardless of the distro ( Unless of course you change the source code )
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

  8. #8

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox

    Quote Originally Posted by jetchisel View Post
    AFAIK if you are root in bash then you will get the # in the prompt regardless of the distro ( Unless of course you change the source code )
    No. It's set in /etc/bash.bashrc (in openSUSE at least):
    Code:
            # Other prompting for root
            if test "$UID" -eq 0  ; then
                if test -n "$TERM" -a -t ; then
                    _bred="$(path tput bold 2> /dev/null; path tput setaf 1 2> /dev/null)"
                    _sgr0="$(path tput sgr0 2> /dev/null)"
                fi
                # Colored root prompt (see bugzilla #144620)
                if test -n "$_bred" -a -n "$_sgr0" ; then
                    _u="\[$_bred\]\h"
                    _p=" #\[$_sgr0\]"
                else
                    _u="\h"
                    _p=" #"
                fi
                unset _bred _sgr0
           else
                _u="\u@\h"
                _p=">"
            fi
    and a few lines below:
    Code:
                PS1="${_t}${_u}:\w${_p} "
    And you can set PS1 to anything you like in /root/.bashrc or /root/.profile anyway, no need to change the source code...

    You're right though that the default is to change to "#" for root as well (in bash at least).

  9. #9
    Join Date
    Feb 2015
    Location
    Chico, California
    Posts
    51

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Hi wolfi323,


    Quote Originally Posted by wolfi323 View Post
    YaST->Security and Users->User and Group Management.


    "linux-infq" is your hostname. The default prompt is set to "user@hostname:currentdirectory> " in openSUSE by default.
    And the "$" does _not_ mean that you are not root. It is just the standard shell prompt if you (or the distro) doesn't change it (actually bash's default is "bash-4.2$ ").
    So in the end, this is just something set up by the distributions. And not all of those distributions you mention use the same shell by default (openSUSE uses bash, Ubuntu uses dash, I don't know about the others)

    You are right though that on openSUSE the root prompt shows "#" instead of the normal ">", to indicate that you are root now.
    But this is not necessarily the case.

    You can change the prompt to whatever you like by setting the variable "PS1" to some value, e.g.:
    Code:
    PS1="Hello master! What can I do for you? "


    YaST->Network Devices->Network Settings->Hostname/DNS.

    You can change it in the terminal with the "hostname" command, see "man hostname".
    I played around with, and found more info on it, the SP1 command. Even SP2. Works well.


    Now, onto the terminal command hostname. Okay, I first went into a terminal to test out changing the hostname. I did this in the terminal:

    Code:
    sudo hostname NewNameHere
    And it worked, it changed the old host name to the new hostname. I just typed the terminal command hostname by itself in the terminal and it displays the new hostname, and I can see the new hostname. Then, I exited the terminal and started the YaST gui control config program. I navigated through YaST like this:

    YaST->Security and Users->Network Services->Hostnames. And a box opens up to display the hostnames, but the new hostname I changed using the terminal is not listed. The only thing listed is other hostnames. Is it suppose to show the new hostname I changed using the terminal at this spot in YaST as well?

    Also, as you know I'm using Virtualbox, and I can take a snapshot of the machine state of openSUSE before I go messing with things, configs, other stuff etc..., and then restore the machine state putting openSUSE back to the way it was before I changed anything, in case I screw something up. This is handy for a newbie like me. As for my host, which is running MS Winows 8.1, I can make system restore points before making any changes to the system. If I screw up, or install a bad program, I just fix it by executing the restore point I created before doing anything, and windows goes through the restore point and resets it back to that point, all is normal again. What I was wondering, does openSUSE have an option to save the machine state so you can restore it back to normal if something goes wrong? From within openSUSE itself. I know I can just create a snapshot using Virtualbox, but I was wondering if you can just do it through openSUSE as well.

    Thanks!

  10. #10

    Default Re: New to Linux. Have questions about terminal prompt and user accounts and Oracle's Virtualbox.

    Hi,

    if you have btrfs filesystem which is the default on 13.2 then yes you can go back in time
    "Unfortunately time is always against us" -- [Morpheus]

    .:https://github.com/Jetchisel:.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •