[wellylug] .profle info

David Antliff dave.antliff at paradise.net.nz
Fri May 13 09:49:02 NZST 2005


On Fri, 13 May 2005, John Durham wrote:

> The documentation I'm studying mentions adding creating aliases and
> adding them to the .profile file. As a past DOS and windows user, I'm
> not used to file names that begin with dots. Is such a file implying
> some variation such as 'user.profile'?

A file that starts with a . is 'hidden' and therefore ignored by most 
shell globbing (e.g. using * wildcard) and directory listings. You can 
view all files, including hidden ones, with 'ls -a'. As for the profile, 
if you are using a bash shell, you can put aliases in ~/.bash_profile 
where ~ means your home directory (/home/username typically). Another 
option is ~/.bashrc - which is actually where I put mine, and my 
.bash_profile 'includes' this.

There is often a bit of confusion and misunderstanding when it comes to 
the roles of .bash_profile and .bashrc - I'm not going to pretend that my 
way is The Right Way but it's always worked for me.

(.bashrc is usually read when opening a new shell, but sometimes 
.bash_profile is instead, so by including/sourcing .bashrc in 
.bash_profile I make sure my shell is always set up the way I want it, 
regardless of how I connected to the machine).

Alternatively, there's a system profile in /etc/profile, but you usually 
don't need to touch that unless you have a bunch of users all requiring 
the same settings.

FYI: there are two special 'hidden' files in every directory:

  .   - this is the same as the current directory, so you can use it to say 
'here' - e.g.  cp /tmp/somefile .

  ..  - this is the immediate parent directory - e.g. cp /tmp/somefile 
../../somewhere_else

Normally doing something like cp * /tmp results in * ignoring all hidden 
files, including . and .. - if it didn't do this, it would recurse down 
the directory tree and have bad results. That's why it's almost always a 
bad idea to do something like this:

  # chmod 777 -R .*

:(


-- 
David.




More information about the wellylug mailing list