rpdom@oz:~$ last | sed -n "2p" rpdom pts/1 :0.0 Tue Dec 29 05:53 still logged in This is what I needed; sorry if I didn't clarify earlier. As shown in the above code, I wanted to grab the second line (in other words, previous login) of the 'last' command (not the previous command.) So since I'll on...
Upon login to a terminal, I've been trying to get the previous login time and whereabouts to show using last, but I'm stumped. Is there any way that I can grab the second line of the last command and echo it? Thanks.
So I put an echo in ~/.bash_profile, ~/.bashrc, and ~/.profile that tells me which code is running upon startup. I found that through SSH both ~/.bash_profile and ~/.bashrc run. However, when running a non-interactive terminal, only ~/.bashrc runs. Would it work to just call a source of ~/.bash_prof...
Hey guys, I've been trying to run some code automatically at the beginning of every terminal session using the file ~/.bash_profile , but for some reason the code only runs when I access the terminal interactively (in other words, through SSH.) The code goes something like this: echo " " echo "Welco...
Hey Guys, So I wasn't thinking straight and added an 'exit 0' to the end of my ~/.bashrc :oops: . Now my terminal only opens for a split second before killing itself. Can I edit the ~/.bashrc file without using terminal? I wasn't able to find it in the file manager (since it is a dot file.) Thanks! :D