How do I execute a script for an indiviual user to run during login?

Updated -

To run a script or command for an individual user when they login, edit the following file:

$ vi /home/user/.bash_profile

For example, to run a bash shell script that lists all HTML files in a directory and printthe first line of each HTML-file to a file called File_Heads, add the following to .bash_profile for a particular user:

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.