When booting 'Bringing up interface eth0' slow and many newbie questions
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
When booting 'Bringing up interface eth0' slow and many newbie questions
Well. That's all the problem is. It takes about a minute. And produces such messages as sending probe 1, 2, 3, 4 and claiming addresses. Not too sure what it is for, but I'm guessing it's something to do networking: I have an ethernet 10/100 connection. Something which I haven't tried yet...
Being very new to Linux I have an abundance of questions which are hopefully so simple that all the experts out there can laugh at them before answering:
a) In Uni, they use Emacs as the editor, and a very useful command I was taught there was Ctrl-x, Ctrl-u to bring up a console screen within Emacs. When I tried this, I got a nice error message though. How do I enable it?
b) The console screen has a silly $ sign after each line. How do I get rid of this?
c) I created a user, but is this necessary since I am the only one to use it?
d) Perhaps the biggest problem: I installed Linux to essentially program. However, upon trying a very simple C++ Hello World program, using emacs as the editor, and creating (I think) the hello executable using the following command:
hello: hello.cpp
g++ -g hello.cpp -o hello
the file hello* appears in the directory. And I can't run it! I've tried running hello*, hello, but nothing seems to work. All I get is
bash: hello: command not found
And who's bash? And how do I get rid of that silly name?
Thank you! (Doubtless I will have further questions as I play around with Linux more...)
b) You have to edit your .bash_profile file in your home directory and change (or create) the value for the environment variable PS1. If you want a familiar DOS or Windows looking prompt you can try:
PS1=\w>
(or PS1="\w>" from the command line to temporarily change the prompt)
Lookup the PS1 bash environment variable on the net for more options...
c) Generally, it is best to use the user you created because then you won't be doing everything as root. If you do every thing as root, you can potentially screw up your system very quickly, and you give quicker access to viruses, trojans, worms, hackers etc....
d) this is because your executable is not in the PATH, try "./hello", which specifies to look for "hello" first in "./" which is a reference to the current path... the "*" is just an indicator meaning the file is executable...
bash is your command shell, and you can't get rid of it, unless you want to use another shell, but they all have silly names, a few are: zsh, tcsh, korn etc... bash is the Unix equivalent of "command.com" it reads input from the command line, parses it and executes the corresponding commands/programs... it also stores environment variables (like the aformentioned PS1) and allows some limited scripting. Some of the other shells allow full-fledged programming, but you can discover that for yourself...
Do you use your ethernet card? Is it connected to a network? Does it work?
a) Sorry -I don't use emacs - could it be a different version? have you got the latest one?
b) Can you post what it looks like and what you want it to look like
c) You should use a user rather than root so that it is more difficult to accidentally damage your system.
d) Make sure you have executeable permissions on the file - if the file is not in your path you should run it as "/path/to/hello" or if it is in the current directory "./hello"
Using Mandrake 9.1. I also have Windows XP on the laptop (please don't kill me...) I use the connection frequently to connect with the home PC (using a FireWire cable), and also to connect to the Uni network. When it went through the sending probe 1 and claiming address stuff, I wasn't connected to anything.
At the moment the console has
[cy00@localhost WHEREEVER_I_AM]$
as the prompt. I have no idea how to change/edit bash. It just seems annoying to have my login displayed and at a localhost. AND with a $ after it. Can't I just have WHEREEVER_I_AM > instead?
Hello World!
It works! But why do I need the ./? Where does just hello actually look? I was told / is the root directory, and ./ is the current directory in Linux. Surely there is some way to just look in the current directory within the console?
Thank you David! That first one is so useful! How do I make it permanent?
Tried that second thing you said, and it indeed does not search the current directory. Isn't it a bit dangerous for it to search all those directories? What if you had multiple instances of the executable in different directories???
Now my Linux likes to sometimes let me run hello.exe without the ./, and sometimes it needs it.
To make the prompt permenant add the command to the end of your profile script:
~/.bash_profile
It is not dangerous at all. If two or more instances are found then the one in the first path will be used.
I can't beleive that it will only sometimes run with or without ./ unless the current directory is in your path variable which I wouldn;t reccomend doing.
you switch back from being root by the command
exit
As for editing ~/.bash_profile, don't do it as root. The ~ specifies the home directory of whoever is issuing the command, so if you use it as root, it will go to the home directory of root and not that of the normal user. The reason why you get permission denied is that the file is write protected by default. The one for a normal user isn't, though.
"~/" Means your home directory. So for edit the file called ".bash_profile" in the home directory of which ever user you want to change the prompt for.
First of all, try setting it up in ~/.bashrc, where ~ is your home directory (also written as /home/your_username. This worked for me. Second, in the .bashrc, add this line:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.