Is there a way to find timestamps of when I connected/disconnected to wireless networks (so I can see where I was at some point in the past)? I can't seem to find any log files with this information (and my system doesn't seem to save logs older than about a month, anyway).

If no such log file exists, it possible to write a script that will do this for me?


P.S. I'm running Ubuntu 10.04.

  • Yes, it is possible. Do you have some scripting experience? – user unknown May 20 '12 at 0:09

You can find some last connections in

sudo less /etc/NetworkManager/system-connections/* 

But the timestamp is of the form


To make it readable, you would use:

date -d "1970-01-01 +1293853087 seconds" 
Sa 1. Jan 03:38:07 CET 2011

For future use, it might be better to insert a few code lines to /etc/networks/ifup.d/YourScript

echo $(date) "  "$(if [ "$IFACE" = eth1 ]; then
    iwconfig | egrep -o "ESSID:*"
fi) >> /var/log/myip.log

or something similar.

I haven't done so, so there are surely some problems to solve. Maybe you don't have write access to /var/log/myip.log, and have to create it with sudo touch ... before, and allow some group (network?) to write to it.

  • Hmm, unfortunately my /etc/NetworkManager/system-connections/ directory is empty? (Maybe I have some setting turned off?) – jiangty May 20 '12 at 0:51
  • @jiangty: Do you use the NetworkManager? – user unknown May 20 '12 at 1:16
  • Sorry for the late response; it at least appears that I use NetworkManager (it's the default way Ubuntu handles internet connection, correct?) – jiangty May 22 '12 at 2:33
  • Yes, at least at 10.04, which I'm still using. – user unknown May 22 '12 at 11:37

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.