Displays live hosts on the same network as the local machine with their hostnames and IP addresses.
This command is IPv6 and multiple network adapter safe and does not rely on awk or sed, however it requires the "nmap" package installed. Might not work on OSX.
Example alias for shell startup file:
alias livehosts='nmap -sP "$(ip -4 -o route get 1 | cut -d " " -f 7)"/24 | grep report | cut -d " " -f 5-'
Show Sample Output
Mount a Windows share. Usually the IP is needed for the $ip_or_host option. Getting hostnames working on a local network never seems to work.
Windows
Another simple way to get external IP or use: wget -qO- http://ipecho.net/plain
Stores the currently active iptables rules to a file that will be applied upon reboot
Shows a single line per interface (device), with its IPv4 settings. Shorter command, better readability in output. Show Sample Output
Get windows version with servicepack and hostname Show Sample Output
changes the PS1 to something better than default. [username.hostname.last-2-digits-of-ip] (current directory) Show Sample Output
Require the moreutils package Show Sample Output
Get the first IPv4 address of an interface Show Sample Output
documents all active ips on a subnet and saves to txt file. Show Sample Output
To save all rules so that they are not lost in case of a server reboot: /etc/init.d/iptables save
commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for: