Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
my prompt is "bash-2.05b#" , but I don't like it , so how to change it and which file should I compile ? how to compile?
I want a prompt like this : " [root@ myname root]#"
Welcome to LQ and Use the Search, Luke! There's a thread about 'What's your prompt look like' and many many references to configuring the prompt besides that.
Also a compiling guide somewhere - I forget where - maybe in the Linux Answers section.
-- Oh, that was one question. You don't 'compile' your PS1 string - you just edit the file. You compile source code to produce binaries.
Originally posted by digiot Welcome to LQ and Use the Search, Luke! There's a thread about 'What's your prompt look like' and many many references to configuring the prompt besides that.
Also a compiling guide somewhere - I forget where - maybe in the Linux Answers section.
-- Oh, that was one question. You don't 'compile' your PS1 string - you just edit the file. You compile source code to produce binaries.
yeah, you are right .
But I have done it ,and I have read the torpic of the 'What's your prompt look like'. I spend some time on it ,but I can't undestand any code yet ! So I don't know what should I do . I have used the " alias ls= 'ls --color' to change my LS display ,and it worked well. In my ROOT home directory , I can't find the '.bashrc' file, and I have readed the /etc/DIR_COLORS and /etc/profile.d/ *.sh , I don'd know how to do it ! Crying
My system is redhat9, I need your help, please give me details.
Thanks!
let me tell you what has hapened, when I upgraded my openoffice, I have used the "openoffice--repair " tools to uninstall it and then install the newest one, which is version 1.1 you know . But it didn't work with my wish and some bad things hapened , when I reboot my system, and ran the terminal , the prompt has changed form "[root@www root]" to "bash-2.05b$" ,but I don't like this style . In the home directory there are usually some files such as .bashrc .dir_color etc. but I could't find them after I upgraded my openoffice.
My meaning is I want to have this style rather yours, you know ?
thanks , I have readed this thread and replies.
I know your meaning, and your tips is very good , but I don't know how to write code, can you understand my meaning? My questions is how to change prompt and which files can i do that?
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963
Rep:
Yes i get your point.
I have not had to change my host name via the linux command line yet.
I know its hard, but you may have to read and learn how to use the command line.
these links should get you started with linux, it wont happen over night.it took me three months before it made sence to me.
Originally posted by tommytomato Yes i get your point.
I have not had to change my host name via the linux command line yet.
I know its hard, but you may have to read and learn how to use the command line.
these links should get you started with linux, it wont happen over night.it took me three months before it made sence to me.
Not sure about the open office stuff and tommytomato's probably got you covered (so this post may be pointless), but I see how that thread I referred to (yep, that was it, tommytomato) wouldn't make much sense without context. If less is your manpager (and maybe otherwise) you can do 'man bash' and then hit the slash key (/) and type PROMPTING and it'll define all those variables. You just plug them in how you want them.
Try 'man hostname' if you want to do something with that - I usually just set it during the install and don't pay much attention after that but it seems like I did change it before.
As far as not having a .bashrc (or a .bash_profile), it's not required, in that /etc/profile takes care of base initialization. But it's just a plain text file - create it and add in your prompt strings, aliases, functions, other environmental variables. Other than functions, it's not really 'programming' and nothing too hard - basically you're just saying 'I want *this* to mean *that*.' Like I change to /var/log/packages a lot and that's a bit to type and tab completion isn't perfect, and there is no 'cdp' command. So I can 'make' one by saying 'alias cdp='cd /var/log/packages''. Now that I've told bash what it 'means', when I type 'cdp', bash 'translates it' to 'cd /var/log/packages'. And like with the prompt string - I'm saying I want PS1 to be equal to 'string', and the string, in turn, is made up of more variables - part of my prompt string is '\w' which just means to display the present working directory in the prompt. Like that.
Never heard of a Linux program clobbering files like that, though. Might want to make a ~/.bashrc and do 'cp .bashrc .bashrc.mybak' so that you have a pretty unclobberable backup. Some text editors make them anyway, depending on the default setup, but those can get overwritten in turn.
Originally posted by digiot Not sure about the open office stuff and tommytomato's probably got you covered (so this post may be pointless), but I see how that thread I referred to (yep, that was it, tommytomato) wouldn't make much sense without context. If less is your manpager (and maybe otherwise) you can do 'man bash' and then hit the slash key (/) and type PROMPTING and it'll define all those variables. You just plug them in how you want them.
.......................................
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.