Hacker News new | past | comments | ask | show | jobs | submit login
Command Line One-Liners (commandlinefu.com)
194 points by aphrax on March 20, 2023 | hide | past | favorite | 23 comments



Sorted by votes: https://www.commandlinefu.com/commands/browse/sort-by-votes

Filter option is nice too, here's top `awk` commands: https://www.commandlinefu.com/commands/matching/awk/YXdr/sor... (expected removing duplicates to be #1 instead of #3)

There are comments too, but some are filled with spam.

See also:

* http://www.compciv.org/unix-tools/

* https://github.com/jlevy/the-art-of-command-line

* https://github.com/learnbyexample/scripting_course#ebooks (my books on grep/sed/awk/perl/ruby/coreutils/etc - free to read online)


It's unfortunate the #2 listing is outdated (python2 vs python3)


Yeah, and that reminds me of stackoverflow answers for older software versions. Also, the comments have the updated command for python3.


Very cool but I have never seen so large spambot density per square 1em as in the comment sections


Completely agree, the spam is a turn off for the site. I assume if someone is smart enough to build a site like this, they know how to eliminate the spam but are just lazy.


1. What's up with that? Looks like testing bots, because most of the messages don't make sense at all.

2. They should mitigate these bots, because ultimately it will make the website annoying to visit.


Looks like oldschool SEO farming by stuffing a bunch of reference links to their site all over the internet so the robots think that tons of people are linking to your site. Don't think it works as well anymore but still a common tactic.


I don't think they're testing bots; many seem to be linking to external sites or advertising something.


Maybe SRE related spam?


I can't stop laughing at the name of the website: I personally would have ended it with "foo" rather that something that can be pronounced "f you" but I'm bookmarking this one for regular reference!


The word "Fu" (pronounced "foo") is a reference to "Kung Fu," a Chinese martial art. It is used colloquially in combination with other words to mean "something someone has to practice to become a skilled expert in." You might see "Google-fu," as in, "skill using search engines to find what you're looking for," or "Spreadsheet-fu," as in, "skill using Microsoft Excel or other spreadsheet programs," or similar things.

In this case, "Command Line Fu" is meant to suggest that the command line is something you can practice to improve your skills with, analogous to a martial art. It's not meant to be pronounced "F you"—though I'm sure you're allowed to continue doing that if you find it amusing!


In case anyone misses it, click the titles and you'll see alternatives.

For example the second most popular one is to serve a directory and the alternatives show the Python3 way of doing it.

https://www.commandlinefu.com/commands/view/71/serve-current...


For the simple tar command, I've read somewhere that it's best to not encode the output using the tar command itself (i.e. tar -cvf blah; zip blah instead of tar -cvzf blah), but I'm not sure what the reasoning is. Has anyone else heard this? Something to do with passing files between systems that may not the right encoding software maybe?


I think it would only makes sense if the target system on which the script may run has `zip` but not a version of `tar` supporting the `-z` option. That's certainly unlikely to ever happen.

There's also `tar -cvf - | zip blah.zip -` with the idea that it's a poor man's way to parallelize the `tar` and `zip` processes but I don't think it makes a real difference in recent implementations of `tar`. At least in a couple of tests I've just run, it's just as fast.


This is amazing, "Watch Star Wars via telnet": https://www.commandlinefu.com/commands/view/1713/watch-star-...


Only bash?


Found some powershell too, but curiously, they seem to be all mixed together.


No, most of them work fine in vanilla sh too :-)


Nice work, but I wonder if websites like this will not become obsolete soon. In most cases I can get the same result with ChatGPT, where I can also ask followup questions.


Where do you think ChatGPT gets the data to try on to produce results from a query? I suspect websites like this are part and parcel of the training data it scours the open web for.


You are right. I only wanted to say, that in the pre-GPT era, such websites were more useful for the programmers as they are now.


Thus the future of AI eating its own tail - when we give up on maintaining the sites that feed the AI because the AI is so good at replacing them.

Then AI stops learning.


This also has the advantage of being browseable. I just sorted by votes and learnt some neat new tricks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: