For Linux and Mac the default Terminal or ITerm2 terminal the default prompt shows the hostname, current directory etc.
Terminals shows the primary prompt PS1 when it is ready to read a command, and the secondary prompt PS2 when it needs more input to complete a command. These prompt strings can be customized by inserting a number of backslash-escaped special characters some of them are as follows:
$PS1="\W"$
Now the Terminal shows something like follows.
To change the behaviour we need to update the .bash or .bash_profile file as per the bash configuration.
And then save the changes and do source ~/.bashrc
Now open a new Terminal and it should reflect the changes.
As shown in the above image it is in the format of [username@hostname CURRENTDIR]$
\d : the date in “Weekday Month Date” format (e.g., “Tue May 26”)
\h : the hostname up to the first ‘.’
\H : the hostname
\n : newline
\r : carriage return
\t : the current time in 24-hour HH:MM:SS format
\V : the release of bash, version + patch level (e.g., 2.00.0)
\w : the current working directory, with $HOME abbreviated with a tilde
\W : the basename of the current working directory, with $HOME abbreviated with a tilde
\! : the history number of this command
\# : the command number of this command
\\ : a backslash
Good thing is that it is configurable. To change it temporarily do the following in the terminal$PS1="\W"$
Now the Terminal shows something like follows.
To change the behaviour we need to update the .bash or .bash_profile file as per the bash configuration.
And then save the changes and do source ~/.bashrc
Now open a new Terminal and it should reflect the changes.
Nice informative blog, it shares more intresting information. This blog is useful to me.
ReplyDeletePHP Training in Bangalore
PHP Training in Chennai
PHP Course in Bangalore
PHP Training Institute in Bangalore
PHP Classes in Bangalore
AWS Training in Bangalore
Data Science Courses in Bangalore
DevOps Training in Bangalore
DOT NET Training in Bangalore
Data Science Course in Chennai
Thanks for sharing informative article with us..
ReplyDeleteDOT NET Training in Chennai
asp .net training in chennai
DOT NET Training Institute in Chennai
.net course in chennai
dot net training in vadapalani
Html5 Training in Chennai
Spring Training in Chennai
Struts Training in Chennai
Wordpress Training in Chennai
SAS Training in Chennai
ReplyDeletevery intersting to read your blog and it makes the viewers to visit your blog and keep on updating.
Software Testing Training in Chennai
Software Testing Training in Bangalore
Software Testing Training in Coimbatore
Software Testing Training in Madurai
Best Software Testing Institute in Bangalore
Software Testing Course in Bangalore
Software Testing Training Institute in Bangalore
Selenium Course in Bangalore
Thanks for your nice post, i am interested to learn online freelancing, but firstly i have to learn computer , could you suggest me please which computer training center best.
ReplyDeleteDot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery
Keep up the good work; I read few posts on this website, including I consider that your blog is fascinating and has sets of the fantastic piece of information. Thanks for your valuable efforts. traffic secrets
ReplyDeleteNice Blog, Keep post more Blogs Thanks for sharing.clearly explained the multi tools latest version in android.
ReplyDeletetally training in chennai
hadoop training in chennai
sap training in chennai
oracle training in chennai
angular js training in chennai