Get all these commands in a text file with description.

for x in `jot - 0 2400 25`; do curl "$x" ; done > commandlinefu.txt
I tried out on my Mac, jot to generate sequence ( 0,25,50,..), you can use 'seq' if it is linux to generate numbers, need curl installed on the machine, then it rocks. @Satya
Sample Output
$ for x in `jot - 0 2400 25`; do curl "$x"  ; done > commandlinefu.txt
# by David Winterbottom

# Serve current directory tree at http://$HOSTNAME:8000/
python -m SimpleHTTPServer

# change to the previous working directory
cd -

# Save a file you edited in vim without the needed permissions
:w !sudo tee %

# Runs previous command but replacing

By: satyavvd
2009-07-23 12:04:02

What Others Think

instead of jot, u can use seq
linuxswords · 645 weeks and 2 days ago
Nice work , most of have would not have read the site API ;)
hemanth · 645 weeks and 1 day ago
Nice work , most of them would not have read the site API ;)
hemanth · 645 weeks and 1 day ago
How does it work with "seq"? I don't have jot installed.
Neo23x0 · 645 weeks ago
Ah - got it for x in `seq 0 25 2400`; do curl "
Neo23x0 · 645 weeks ago
And now we all hammer the tar out of the API. :)
jbroome · 643 weeks and 6 days ago
It's really inconsiderate to hammer a site as quickly as you can; please don't do that. I suggest inserting "sleep 15; "
ger · 643 weeks and 5 days ago
curl can do this all by itself: curl -O[0-2400:25] Afterwards, simply cat all the files! No jot, no seq.
Dynetrekk · 643 weeks and 4 days ago
You can also use c-style for loops in bash: for (( x=0; x<=2400; x+=25 )); do sleep 15; curl ...
dennisw · 639 weeks and 3 days ago
Jeepers - I might have to put some capping on the API requests. Yes, a few selected "sleep" commands would be appreciated.
root · 638 weeks and 5 days ago
Create a temp directory to hold all the files downloaded. Then use "curl -O Then run this in the same directory to concatenate all the files into one single text file: "ls -1 | sort -n | while read mork ; do cat $mork >> commandlinefu.txt ; ls -ald $mork; done" The "ls" command is just to give you something to look at while this runs...
SuperFly · 636 weeks and 3 days ago
Hmm. Something got cut off. The curl command referenced is curl -O[0-2400:25], as suggested by Dynetrekk 7 weeks ago
SuperFly · 636 weeks and 3 days ago

What do you think?

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.

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

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: