Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Now available on Stack Overflow for Teams! AI features where you work: search, IDE, and chat.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Just put this in ~/.bashrc~/.bashrc or /etc/bash.bashrc/etc/bash.bashrc if you want this for all users:
~/.bashrc
/etc/bash.bashrc
if [[ -n $SSH_CONNECTION ]] ; then echo "I am logged in remotely" fi
Just put this in ~/.bashrc or /etc/bash.bashrc if you want this for all users:
if [[ -n $SSH_CONNECTION ]] ; then echo "I'm"I am logged in remotely" fi
if [[ -n $SSH_CONNECTION ]] ; then echo "I'm logged in remotely" fi
David already basically answered your question, but let me give you a ready example.