Mohammedz.com

For Linux and Shell scripting.

/etc/skel directory: Do something special for all users on a system.

1 Comment


I was wondering how can I run few programs for every users while they are logging in & logging out. After a bit of searching I reached at /etc/skel/ directory. Yes, it was the perfect match for my requirement !.

You might have seen few files like .bashrc, .bash_profile (.profile), .bash_logout in every users home directory. Do you know how these files are being generated for the first time?. Yes, it is from /etc/skel/ directory. If you check this directory, you can see all the above mentioned files there.

If you want to verify this, go to /etc/skel/ directory and create a test file. Then, create a new user in the system. When you log into the system as the new user, you can see the testfile in the home directory.

Advertisements

One thought on “/etc/skel directory: Do something special for all users on a system.

  1. Hi! I was surfing and found your blog post… nice! I love your blog. 🙂 Cheers! Sandra. R.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s