3
1
I'm trying to figure out which "script" (really it's probably an "*rc" file) is running a particular command when I reboot my ubuntu machine. I've tried grepping for what is being displayed when I log into the machine after a reboot but I haven't been able to find it.
I know that, for example, the .bash_profile is "sourced" when I log in but what others are run This will help me track down the script/file that's running an old set of commands that I need to update.
Thanks!
here's what happens when i log in:
bos-mp2o6:~ user$ ssh -A X.X.X.X
user@X.X.X.X's password:
Linux bos-lpwy9 2.6.32-54-generic #116-Ubuntu SMP Tue Nov 12 19:23:22 UTC 2013 x86_64 GNU/Linux
Ubuntu 10.04.4 LTS
Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/
New release 'precise' available.
Run 'do-release-upgrade' to upgrade to it.
Last login: Tue Dec 31 10:53:25 2013 from 172.19.43.138
Agent pid 2117
/home/user/.ssh/internal/2013-07-29: No such file or directory
/home/user/.ssh/deployed/2013-07-29: No such file or directory
Identity added: /home/user/.ssh/external/2013-07-29 (/home/user/.ssh/external/2013-07-29)
if you notice the "Identity added" piece, that's the bit I'm looking for. So I've used the following command (with no luck):
[user@Linux_Desktop:~]$grep_bash 2013-07-29
[user@Linux_Desktop:~]$
which shell (interactive or non-interactive) am I using when I ssh into my ubuntu machine from a MacOSX machine? – Ramy – 2013-12-31T16:32:19.900
@Ramy if you
ssh
in, you're using an interactive, login shell, so you need to check~/.profile
,~/.bash_login
,~/.bash_profile
and/etc/profile
. – terdon – 2013-12-31T16:33:58.823great. and - sorry - but what is cc2ter in your answer? When I pipe to that I get a 'command not found' message. – Ramy – 2013-12-31T16:35:45.570
@Ramy argh, sorry, should have deleted that. Never mind, it is just a trick I use to change my actual username to
terdon
for posting answers here :). Also make sure to use the edited version of the function, I had something that was left over from a previous version. The one there now should work. – terdon – 2013-12-31T16:37:34.340Thank you so much for the thorough answer, Terdon. Would you mind revisiting my updated question? your f(x) isn't working for me. Maybe my assumptions were wrong? – Ramy – 2013-12-31T16:46:19.950
@Ramy first, make sure you copied the function properly (since the 1st version had an error) you can also simply try
grep 2013-07-29 ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_login /etc/profile /etc/bash.bashrc /etc/environment
. However, that looks like it might be coming fromssh
and notbash
. Have a look at your~/.ssh/config
file (on your local and the remote machine). – terdon – 2013-12-31T16:50:33.050this is quite odd:
grep 2013-07-29 ~/.bashrc ~/.profile ~/.bash_profile ~/.bash_login /etc/profile /etc/bash.bashrc /etc/environment
returns:grep: /home/rabdelaz/.profile: No such file or directory grep: /home/rabdelaz/.bash_login: No such file or directory
I get that those files don't exist but...it seems as though that '2013-07-29' is coming from SOMEWHERE, right...? – Ramy – 2013-12-31T16:54:48.197let us continue this discussion in chat
– terdon – 2013-12-31T16:57:36.437