Commands tagged loop (35)

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

Send your svn diff to meld
If you like to view what has been changed between revision 100 and the BASE on FILE. Meld will give you a nice overview.

Calculate days on which Friday the 13th occurs (inspired from the work of the user justsomeguy)
Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale.

Listen Digitally Imported Radio from CLI (without premium!)
This commands does just two things: fakes user agent (the one was taken from recent Android app) and sends the (possibly) listener ID (it can be any - I put "1" here because it works like a charm - after the name of stream ?1 as you can see). Look for the list of stations here: Or here: Best regards, sxiii :)

Search and display with VIMs syntax highlighting!
Multi-argument version, but with VIM loveliness :D

determine if tcp port is open
for udp nmap -sU -p 80 hostname

Burn an audio CD.
My variation on an audio burning command from commandlinefu - this one doesn't crap out if you want to burn a CD in a directory whose permissions don't allow it, and instead rips everything to /tmp. If you mount your music partition like I do using Samba, you probably don't have write permission inside that file system in order to create the temporary directory other audio burning commands here use. Not a bad idea to add cdrom to your groups, and /bin/eject with visudo.

Quickly build ulimit command from current values
It is helpful to know the current limits placed on your account, and using this shortcut is a quick way to figuring out which values to change for optimization or security. Alias is: $ alias ulimith="command ulimit -a|sed 's/^.*\([a-z]\))\(.*\)$/-\1\2/;s/^/ulimit /'|tr '\n' ' ';echo" Here's the result of this command: $ ulimit -c 0 -d unlimited -e 0 -f unlimited -i 155648 -l 32 -m unlimited -n 8192 -p 8 -q 819200 -r 0 -s 10240 -t unlimited -u unlimited -v unlimited -x unlimited $ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 155648 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 8192 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) unlimited virtual memory (kbytes, -v) unlimited file locks (-x) unlimited

Show current working directory of a process

Grab just the title of a youtube video
There's another version on here that uses GET but some people don't have lwp-request, so here's an alternative. It's also a little shorter and should work with most youtube URLs since it truncates at the first &

Transfer large files/directories with no overhead over the network
This invokes tar on the remote machine and pipes the resulting tarfile over the network using ssh and is saved on the local machine. This is useful for making a one-off backup of a directory tree with zero storage overhead on the source. Variations on this include using compression on the source by using 'tar cfvp' or compression at the destination via $ ssh [email protected] "cd dir; tar cfp - *" | gzip - > file.tar.gz

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: