terminal prompt

General discussion Forum. All YDL related question which are not Install or Beginner questions.

terminal prompt

Postby zebralips » 17 May 2011, 21:22

i am migrating from a mac and have only seen a term window there.
and its default shell "bash".

so i am wondering about the default prompt in YDL term window.
it looks like a associative array.
sample:
Code: Select all
dog[blackLab] = spot

and i could see if i am throwing everything off kilter if this is a bass ackwards question.

why is the name in brackets [name] and why is it written as @, it has been a long time since i saw the meaning for @ in programming sintax.
the only way i can learn is reading and studying a lot and connecting the dots.
but here i will ask , why.
thank you
zebralips
ydl newbie
ydl newbie
 
Posts: 12
Joined: 14 May 2011, 14:01

Re: terminal prompt

Postby aguilarojo » 18 May 2011, 01:56

zebralips wrote:i am migrating from a mac and have only seen a term window there.
and its default shell "bash".

so i am wondering about the default prompt in YDL term window.
it looks like a associative array.
sample:
Code: Select all
dog[blackLab] = spot

and i could see if i am throwing everything off kilter if this is a bass ackwards question.

why is the name in brackets [name] and why is it written as @, it has been a long time since i saw the meaning for @ in programming sintax.
the only way i can learn is reading and studying a lot and connecting the dots.
but here i will ask , why.
thank you


It took me awhile to remember what you meant by an associative array, but it came back to me as I was putting this explanation together for you. What you are looking at within the terminal is definitely not that. You can look through the details which follow, as well as their links more carefully later. For now I'll refer to what a standard terminal within YDL which opens as standard bash, looks like:

Code: Select all
[aguila@arakus Downloads]$


The above is how my terminal appears in YDL. This is what the terminal is telling us about itself:

  • User: aguila; This is my user name within YDL which is used to access applications within YDL such as OpenOffice.org, Gimp, and other applications. If I was doing programming I would switch into root mode and under that circumstance the User name would appear as root. The exception, of course, is if I set the superuser account to so that aguila is defined as superuser then when using the superuser command the User name would remain as aguila.

  • @: refers to the system itself, consider it as no more than a label.

  • System or Host Name: This is defined when YDL is first installed. If the Host Name is undefined in that case the name which appears in this field is localhost. The name I provided to my system is arakus.

  • Directory location: The current directory location I moved into. In this example I moved into the Downloads directory.
    The open and close of the brackets are what the system needs to know regarding who is accessing it's services, where it is being directed to go. The $ represents that the system is waiting for the next command.
The Terminal application available in OS X does allow for switching between various shells but not as many as Linux, which includes YDL. The reason why is more an issue of what Apple allows the Terminal application to have extensions to. However in Linux, and YDL in particular, you can add as many shells to the CLI (command line interface) as you need as long as yum (the package manager employed in YDL and Red Hat systems) knows about them. As you are beginning your Linux experience with YDL, learning about the different shells and switching between them should be useful. Different shells look different and serve different purposes however as you are a beginner you can research those particular differences for yourself as those differences may actually not matter in your case. So feel free to refer here. If you refer to this link you can see as you scroll down how bash (one of the shells) is used in YDL versus how bash appears in OS X within the Terminal.

You'll notice that the brackets appear in the Terminal application of OS X when one switches to csh.
Last edited by aguilarojo on 23 Sep 2011, 15:48, edited 1 time in total.

Everything on the Earth has a purpose.
Every disease an herb to cure it.
And every person has a mission.
This is the Indian Theory of Existence.
-- Morning Dove, Salish (1888-1936)
User avatar
aguilarojo
ydl guru
ydl guru
 
Posts: 227
Joined: 06 May 2009, 14:50
Location: New York City

Re: terminal prompt

Postby ppietro » 18 May 2011, 06:46

zebralips wrote:i am migrating from a mac and have only seen a term window there.
and its default shell "bash".


That is the default shell in Linux as well. Interestingly, the original shell in Mac OS X was tcsh - they've only switched to bash recently.

zebralips wrote:why is the name in brackets [name] and why is it written as @, it has been a long time since i saw the meaning for @ in programming sintax.


aguilarojo wrote:It took me awhile to remember what you meant by an associative array, but it came back to me as I was putting this explanation together for you. What you are looking at within the terminal is definitely not that. You can look through the details which follow, as well as their links more carefully later. For now I'll refer to what a standard terminal within YDL which opens as standard bash, looks like:
Code: Select all
[aguila@arakus Downloads]$


BTW - you can set the prompt in bash to whatever you like. More info here:
http://ss64.com/bash/syntax-prompt.html
and
http://www.faqs.org/docs/Linux-HOWTO/Ba ... HOWTO.html

Cheers,
Paul
User avatar
ppietro
Site Admin
Site Admin
 
Posts: 4965
Joined: 13 Sep 2007, 22:18

Re: terminal prompt

Postby aguilarojo » 18 May 2011, 17:12

ppietro wrote:...
BTW - you can set the prompt in bash to whatever you like. More info here:
http://ss64.com/bash/syntax-prompt.html
and
http://www.faqs.org/docs/Linux-HOWTO/Ba ... HOWTO.html

Cheers,
Paul



The links which Paul provided are really good, as they allow zebralips (and others) to have a deeper understanding how the bash shell can be modified according to one's personal tastes. Keep in mind that modification of all terminal shells are possible also although there are different procedures required to do that. While it is tempting to make such modifications now, I would recommend that beginners and others not familiar with the Linux environment get more involved in other aspects of Linux programming first before they delve into the nuances of shell programming or modifications. There are other things to pick up regarding YDL anyway such as setting up the network, establishing wifi parameters and security, and more.

Zebralips remember to access this page for more details.
Last edited by aguilarojo on 18 May 2011, 23:50, edited 1 time in total.

Everything on the Earth has a purpose.
Every disease an herb to cure it.
And every person has a mission.
This is the Indian Theory of Existence.
-- Morning Dove, Salish (1888-1936)
User avatar
aguilarojo
ydl guru
ydl guru
 
Posts: 227
Joined: 06 May 2009, 14:50
Location: New York City

Re: terminal prompt

Postby zebralips » 18 May 2011, 23:09

Thank you every one.
now i just need to start a library of information.
Thank you, again.
zebralips
ydl newbie
ydl newbie
 
Posts: 12
Joined: 14 May 2011, 14:01


Return to General

Who is online

Users browsing this forum: No registered users and 4 guests