What's New!

Chat with

How to Defend
Your Computer 

The Guides
to (mostly) 
Harmless Hacking

Happy Hacker 
Digests (old stuff) 

Hacker Links 


Meet the 
Happy Hacksters 

Help for 



It Sucks 
to Be Me!

How to Commit
Computer Crime (not)! 

What Is a 
Hacker, Anyhow? 

Have a 
Great Life! 

News from the 
Hacker War Front

The Bash Shell,continued...

Bash Startup File

    If you have read the previous guides, you will know that bash provides
you with some startup files which get run whenever you log into a bash
shell. The file I am talking about is your profile. This can be called
.bash_profile, .bash_login, or .profile and is located in your home directory.

   If you don't have this file, then just create it in your favorite text
editor. Then you can insert any alias commands you want, and next time you
log in, they will all be active.

    Or, you can write the file now and use the 'source' command to execute
your profile without logging out:

source .profile

(or substitute for ".profile" whatever your profile is called.)

  You can kill your account -- warning!
 Adding things to .profile should be tested ONLY with the "source
.profile"  command!!! And only if you are satisfied with the result, log out
and login again!!!
   Reason: Imagine you wrote an "exit" at the wrong place (i.e. not
preceding it with a comment-sign), you will never be able to login!
   A solution is to login twice, one shell is good for testing the other one
for recovering from errors!!!  You can login twice with the command "telnet
localhost". Then if you mess up in this second shell you will wind up back
in your first shell and can delete the profile file before it kills   your
shell again.  This saves the embarrassment of having to call tech support
and confess to having made a big mess of your account.

More on the bash shell --->>

Carolyn's most
popular book,
in 4th edition now!
For advanced
hacker studies,
read Carolyn's
Google Groups
Subscribe to Happy Hacker
Visit this group


Return to the index of Guides to (mostly) Harmless Hacking!

 © 2013 Happy Hacker All rights reserved.