


The '$' symbol preceding the PS1 variable name is different from the '$' symbol at the end of the prompt. The command prompt is set by the 'PS1' environmental variable, you can see what your current 'PS1' variable is set to by issuing this command: ~]$ echo $PS1 Now, since I've covered the basics of command prompt and the meanings of the different parts, I'll show you how you can customize your prompt. The general format of the default command prompt is: cwd]$ or #. The # symbol is the prompt designation for the root account.
MINUS MAC TERMINAL EMULATOR FULL
If you’re logged in as the 'root' user, the full prompt changes to ~]#. The $ symbol is the default for regular users. The $ means that I'm logged into this system as a regular user. The full path is not displayed in the prompt but only the current working directory. However, if I cd to the /etc/sysconfig directory, my prompt is displayed sysconfig] $. If I cd to the /etc directory, the prompt etc] $. If you navigate to a different directory this is where you will find where you’re currently working, this is very useful information, so you don’t get lost in the filesystem. My prompt in the image above shows `~` meaning I’m currently working inside my home directory which is '/home/kc'. The '~' represents home directory of currently logged in user. This part of the command prompt simply displays your current working directory. The 'localhost' designation is my Linux system’s name (hostname) and the default for any newly installed system if you don't specify a hostname during installation. You can change your hostname using the 'hostnamectl' command. The symbol is a separator between the username and the hostname. The text 'kc' (My initials) is the currently logged in username. I'll further break down this prompt into smaller parts so you can see what they mean. You’ll see "blinking cursor" followed by the prompt waiting for your commands. My ~] $ " is the text field that provides some information about the Linux system. Look at my command prompt in the screenshot above. Your command prompt will differ from mine.
