Use it like this below: vnstat -u -i interface forces a database update for interface or creates the database if it doesn't exist. This is usually the first command used after a fresh install. vnstat -u -i interface --nick nick gives interface the nickname nick and that information will be later included with queries. vnstat -u -r --disable -i interface resets the internal counters of interface and disables it from being updated before enabled again with the --enable parameter. This feature is especially useful for interfaces like ppp0 that aren't always active. And one of out put will be below, sudo /usr/bin/vnstat -l Monitoring ppp0... (press CTRL-C to stop) rx: 0.00 kB/s 0 p/s tx: 0.00 kB/s 0 p/s^C ppp0 / traffic statistics rx | tx --------------------------------------+---------------------------------------- bytes 0 kB | 0 kB --------------------------------------+---------------------------------------- max 0.05 kB/s | 0.03 kB/s average 0.01 kB/s | 0.00 kB/s min 0.00 kB/s | 0.00 kB/s --------------------------------------+---------------------------------------- packets 1 | 1 --------------------------------------+---------------------------------------- max 0 p/s | 0 p/s average 0 p/s | 0 p/s min 0 p/s | 0 p/s --------------------------------------+---------------------------------------- time 17 seconds It has got so many wonderful switch to get the exact data you need.
Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?
You must be signed in to comment.
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: