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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content