4 ms·
I don't think these tips are that great. Some random criticisms: ifconfig is deprecated (use "ip" instead). There is not much value in knowing vim if you kno
by jrockway 16y ago
I don't think these tips are that great. Some random criticisms:
ifconfig is deprecated (use "ip" instead).
There is not much value in knowing vim if you know Emacs. If you want to edit something in your terminal, well, emacsclient -t to your Emacs session. Or use mg, which is a very fast and light Emacs workalike -- just enough for editing your /etc/apt/sources.list to get Emacs installed :)
- spudlyo 16y agoYou can also use nano, which has similar key bindings and is often installed by default, which will do in a pinch until you can install emacs.
- zerokyuu 16y agoAt first I thought you meant "use 'ipconfig' instead" and I was like, "Whaaaaat?!". Then I checked the man page for "ip". Thank you. It looks rather useful. I don't mess with routing or devices too much but I have in the past and only knew about ifconfig.
- jrussbowman 16y agoFunctionally as a sysadmin, I've heard ifconfig is deprecated before yet I've never used ip. just 'ifconfig' on the command line tells me everything I need to know about what interfaces are up, their status and basic info. 'ip' just gives me the standard syntax description. The power of the basic shell is that there's usually a few hundred ways to skin a cat. And just because there's documentation saying something is deprecated as often as not it's still so widely used that in practice, it's not.
- thwarted 16y agoifconfig doesn't show the additional IPs on an interface unless they are bound to aliased interface names (eth0:0)
- jrussbowman 16y agotrue, but that's how we've always done it where I work. We use chroot to support multiple web apps with their own ip/domain on a single box. real simple to just add a new /etc/sysconfig/network-script/ifcfg-eth#:# with the proper network config. We can then ifup and ifdown them as necessary, they come up on boot if the config is set... Just always made sense :)
- ominous_prime 16y agoThis isn't really an argument for using ifconfig. On RHEL and related systems, ifup, ifdown, and everything in /etc/sysconfig/network-scripts/ are all implemented with the `ip` command.
- veritgo 16y agoifconfig is deprecated, so probably a good idea to get out of that habit. Particularly if you are using it in scripts. 'ip addr' should give you all the information that 'ifconfig' does. You can also make the output a little less chatty by doing 'ip -o -4 addr' to get IPv4 addresses on one line per interface, or 'ip -o -0 addr' to get MAC addresses displayed similarly. This can make awking / cutting for addresses to use in scripts a little more elegant.
- davedavedave 16y agoI didn't know about the one-per-line option, so thanks for that. Commands I use regularly instead of using ifconfig: # link up/down ip link set dev eth0 up|down # add a new address ip addr add dev eth0 172.16.43.124/24 # to clear all IP addresses from eth0 ip addr flush dev eth0 # delete an address ip addr del dev eth0 172.16.43.124/24 # add default route ip route add default via 172.16.43.254 Edit: I fail at formatting
- mattdeboard 16y agoYou don't think these tip are that great for you. But they're not written for Unix command-line ninjas. They're written for average users (like me) who run Ubuntu or some other flavor of Linux and just use the basic commands. I bookmarked the tips and will definitely be revisiting them regularly to improve my command line fu. Sorry you didn't get anything out of it, but I suspect you don't need tips like "learn vim" and "be familiar with chown".
- angusgr 16y agoOr use mg, which is a very fast and light Emacs workalike There's also zile, another mini-emacs (great if you run Linux on small embedded computers.) I haven't used mg yet, so I don't know how they stack up against each other. I do have a creeping feeling I should some day bite the bullet and learn more than 4 vi commands, though.
- angus77 16y agoWhen I want emacs to be fast & light I just do emacs -Q.
- X-Istence 16y agoWait, what? ifconfig is deprecated? Now I need to start typing ip on Linux , yet another variation from my BSD machines where ifconfig is definitely still in use, and Windows where I have to use ipconfig.
- vacri 16y ago'ip' does a hell of a lot more than just list devices. It's really worth learning how to use it. you also don't need root rights to use it for display - although ifconfig can be run as a regular user, it's not on the path by default so it usually won't show up.
- masklinn 16y ago'ip' is also much, much less portable than ifconfig.
- X-Istence 16y agoifconfig is on the PATH by default for FreeBSD, Mac OS X, and OpenSolaris... to me it was always rather irritating that wasn't the case in Linux when I needed to find out the IP address of a machine. I really don't understand why there is a need to throw out a perfectly good tool to replace it with something that is completely different and requires re-learning, and re-writing of scripts that are already using ifconfig.
- geoka9 16y agoI think you still need to be comfortable with basic vi commands as it is _the_ standard editor in Unix. Many a times I've found myself in situations when I had to quick-edit a config file on a new bare-bones server with only vi installed. As for the quick Emacs workalikes - they are exotic and you can't always be expected to know the packaging commands of the odd Unix system you happen to be working with. And sometimes installing new packages is not an option.
- maweaver 16y ago> ifconfig is deprecated Deprecated by whom? Is there any source on this? Nothing is mentioned in the man page, and googling for it turns up a wikipedia article with a [citation needed], a reddit discussion from today linking to wikipedia, and this discussion.
- ominous_prime 16y agohttp://lartc.org/howto/lartc.iproute2.html#LARTC.IPROUTE2.WHY http://lartc.org/howto/lartc.iproute2.html#LARTC.IPROUTE2.WH...
- ralphc 16y agoBasic vi knowledge may not be needed if you only work in Linux, but in my job I can work on Linux, AIX, Solaris, and HP-UX, and vi is the only editor that you can find on all of them in their base installs.