This will print a random emoji within the range of 1F600 - 1F64F, which includes all the face emoji. Obviously, this will only show something meaningful if your terminal can display emoji, but it may be useful in scripts. This likely requires recent versions of bash Show Sample Output
-L tells find to follow symbolic links, so -type l will only return links it can't follow (i.e., those that are broken).
Fetches the world population JSON data from the US census and parses it uses jshon Show Sample Output
If you update youtube-dl from the repos, it becomes out-of-date quickly. Luckily, it can auto-update. Show Sample Output
I'm not sure why you would want to do this, but this seems a lot simpler (easier to understand) than the version someone submitted using awk.
If X is 5, it will about a number between 1 and 5 inclusive. This works in bash and zsh. If you want between 0 and 4, remove the +1.
List all files from the current directory and subdirectories, sorted by modification time, oldest first.
I'm pretty sure everyone has curl and sed, but not everyone has lynx. Show Sample Output
This is better than doing a "for `find ...`; do ...; done", if any of the returned filenames have a space in them, it gets mangled. This should be able to handle any files. Of course, this only works if you have rename installed on your system, so it's not a very portable command.
If you don't want to delete them, but just want to list them, do
find -L /path -type l
If you want to delete them with confirmation first, do
find -L /path -type l -exec rm -i {} +
Using the -L flag follows symlinks, so the -type l test only returns true if the link can't be followed, or is a symlink to another broken symlink.
This will update the tarball, adding files that have changed since the last update. This assumes that the tarball is in the same directory as the files being archived. N.B. This command can't be used on compressed tarballs. N.B. This will add the updated files to the tarball, so that the tarball will have two versions of each file. This will make the tarball larger, but doesn't have any other significant effect.
pi 66
This prints out the first 66 digits of pi.
number
This takes any number (no more than 66 digits long) from stdin (or on the command line), and tells you how to say it. E.g
number 365
outputs "three hundred sixty-five"
If you're like me and want to keep all your music rated, and you use xmms2, you might like this command. I takes 10 random songs from your xmms2 library that don't have any rating, and adds them to your current playlist. You can then rate them in another xmms2 client that supports rating (I like kuechenstation). I'm pretty sure there's a better way to do the grep ... | sed ... part, probably with awk, but I don't know awk, so I'd welcome any suggestions. Show Sample Output
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: