Mostly Linux & Python syntax notes and hyperlinks.

Friday, January 28, 2011

Linux: Using whereis to find ifconfig

If something isn't in default path you still may be able to find it with whereis:

$ ifconfig
bash: ifconfig: command not found
$ whereis ifconfig
ifconfig: /sbin/ifconfig /usr/share/man/man8/ifconfig.8.gz
$ /sbin/ifconfig
eth2 Link encap:Ethernet HWaddr ...

Tuesday, January 4, 2011

Linux: to grep for dash, use grep --

For example, to search for python code containing the string "-D":
grep -- -D *.py
From http://stackoverflow.com/questions/2427913/grepping-for-string-containing-dash