Commands tagged bandwidth (7)

  • The command copies a file from remote SSH host on port 8322 with bandwidth limit 100KB/sec; --progress shows a progress bar --partial turns partial download on; thus, you can resume the process if something goes wrong --bwlimit limits bandwidth by specified KB/sec --ipv4 selects IPv4 as preferred I find it useful to create the following alias: alias myscp='rsync --progress --partial --rsh="ssh -p 8322" --bwlimit=100 --ipv4' in ~/.bash_aliases, ~/.bash_profile, ~/.bash_login or ~/.bashrc where appropriate. Show Sample Output

    rsync --progress --partial --rsh="ssh -p 8322" --bwlimit=100 --ipv4 .
    ruslan · 2011-02-10 14:25:22 2
  • Limits the usage of bandwidth by apt-get, in the example the command will use 30Kb/s ;) It should work for most apt-get actions (install, update, upgrade, dist-upgrade, etc.)

    sudo apt-get -o Acquire::http::Dl-Limit=30 upgrade
    alemani · 2010-03-22 01:29:44 1
  • the command is obvious, I know, but maybe not everyone knows that using the parameter "-l" you can limit the use of bandwidth command scp. In this example fetch all files from the directory zutaniddu and I copy them locally using only 10 Kbs

    scp -l10 pippo@serverciccio:/home/zutaniddu/* .
    0disse0 · 2010-02-19 16:44:24 1
  • On the machine acting like a server, run: iperf -s On the machine acting like a client, run: iperf -c where is the ip or hostname of the server. Show Sample Output

    iperf -s
    forcefsck · 2011-01-24 07:58:38 0
  • Nethogs groups bandwidth by process. Show Sample Output

    sudo nethogs eth0
    totti · 2013-01-25 08:20:44 2
  • in Debian-based systems apt-get could be limited to the specified bandwidth in kilobytes using the apt configuration options(man 5 apt.conf, man apt-get). I'd quote man 5 apt.conf: "The used bandwidth can be limited with Acquire::http::Dl-Limit which accepts integer values in kilobyte. The default value is 0 which deactivates the limit and tries uses as much as possible of the bandwidth..." "HTTPS URIs. Cache-control, Timeout, AllowRedirect, Dl-Limit and proxy options are the same as for http..."

    sudo apt-get -o Acquire::http::Dl-Limit=20 -o Acquire::https::Dl-Limit=20 upgrade -y
    ruslan · 2011-02-14 05:24:49 0
  • Trickle is here: Trickle is a simple bandwidth limiter

    trickle sudo apt-get update -y
    mrman · 2011-02-15 02:05:37 0

What's this? 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.

Share Your Commands

Check These Out

Move all images in a directory into a directory hierarchy based on year, month and day based on exif information
This command would move the file "dir/image.jpg" with a "DateTimeOriginal" of "2005:10:12 16:05:56" to "2005/10/12/image.jpg". This is a literal example from the exiftool man page, very useful for classifying photo's. The possibilities are endless.

Look up the definition of a word
A bash function might also be useful: $ dict() { curl dict://$1; } Or if you want less verbose output: $ dict() { curl -s dict://$1 | perl -ne 's/\r//; last if /^\.$/; print if /^151/../^250/'; }

Encrypted archive with openssl and tar
The lifehacker way: "That command will encrypt the unencrypted-data.tar file with the password you choose and output the result to encrypted-data.tar.des3. To unlock the encrypted file, use the following command:" $ openssl des3 -d -salt -in encrypted-data.tar.des3 -out unencrypted-data.tar

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Wait for file to stop changing
Here's a way to wait for a file (a download, a logfile, etc) to stop changing, then do something. As written it will just return to the prompt, but you could add a "; echo DONE" or whatever at the end. This just compares the full output of "ls" every 10 seconds, and keeps going as long as that output has changed since the last interval. If the file is being appended to, the size will change, and if it's being modified without growing, the timestamp from the "--full-time" option will have changed. The output of just "ls -l" isn't sufficient since by default it doesn't show seconds, just minutes. Waiting for a file to stop changing is not a very elegant or reliable way to measure that some process is finished - if you know the process ID there are much better ways. This method will also give a false positive if the changes to the target file are delayed longer than the sleep interval for any reason (network timeouts, etc). But sometimes the process that is writing the file doesn't exit, rather it continues on doing something else, so this approach can be useful if you understand its limitations.

Find Malware in the current and sub directories by MD5 hashes
Command makes use of the Malware Hash Registry ( It parses the current directory and subdirectories and calculates the md5 hash of the files, then prints the name and sends the hash to the MHR for a lookup in their database. The 3rd value in the result is the detection percentage across a mix of AV packages.

Quick and dirty RSS
runs an rss feed through sed replacing the closing tags with newlines and the opening tags with white space making it readable.

resolve short urls
since the most url shorteners respond with a header containing the Location: ... this works with most common shorteners

Print a list of installed Perl modules
This version works on an AIX system on which I have very limited permissions. The other version fails with "Can't open file /usr/opt/perl588/lib/site_perl/5.8.8/aix/auto/DBI/.packlist".

Put a console clock in top right corner
This puts a clock in the top right of the terminal. This version doesn't use tput, but uses escape codes

Stay in the loop…

Follow the Tweets.

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.


Subscribe to the feeds.

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: