So I've been looking around and I can find ways to run commands every time you open a new terminal and inadvertently figured out how to make a continuous loop of opening terminals.

I've edited .bashrc .bash_login .bash_profile .bash_alias .profile (each separately) and nothing has worked besides the .profile and .bash_alias but this happens EVERY time I open a new terminal. I even made my own scrip and added it to the /.config/startup/ .desktop Nothing..

All I want is when I login a terminal opens (already set in startup app) then run something like ls -l and df -h or whatever else I could want further down the line.

Even better if there's some way to open another terminal after that to work from and without creating that continuous loop..

This is what I want my desktop to look like at login:


  • Undo the changes you've done to .profile and .bashrc . You don't need them unless your intention is to have something run every single time you open terminal, not just single window upon login – Sergiy Kolodyazhnyy Apr 30 '16 at 2:41

What you want is this:

gnome-terminal -e 'bash -c "df;bash"' 

The gnome-terminal by default runs any single command passed to it as single shot and exits. Thus you want to call a single command capable of running multiple, which is what bash -c "df;bash" does - it will run df, then spawn another instance of bash and prevent window from exiting one df completes execution.

Finally, add that to startup applications

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.