Commands by TetsuyO (5)

  • Finds files modified today since 00:00, removes ugly dotslash characters in front of every filename, and sorts them. *EDITED* with the advices coming from flatcap (thanks!)


    -2
    find -maxdepth 1 -type f -newermt "00:00" -printf "%f\n" | sort
    TetsuyO · 2013-03-23 12:50:01 8
  • This oneliner gets all the 'modified' files in your git repository, and opens all of them in vim. Very handy when you're starting to work in the morning and you simply want to review your modified files before committing them. Maybe there are better ways to do that (and maybe integrated in vim and/or git, who knows), but I found quicker to do this oneliner.


    0
    vim `git status | grep modified | awk '{print $3}'`
    TetsuyO · 2012-11-19 09:48:46 6
  • Substitute that 724349691704 with an UPC of a CD you have at hand, and (hopefully) this oneliner should return the $Artist - $Title, querying discogs.com. Yes, I know, all that head/tail/grep crap can be improved with a single sed command, feel free to send "patches" :D Enjoy! Show Sample Output


    -1
    wget http://www.discogs.com/search?q=724349691704 -O foobar &> /dev/null ; grep \/release\/ foobar | head -2 | tail -1 | sed -e 's/^<div>.*>\(.*\)<\/a><\/div>/\1/' ; rm foobar
    TetsuyO · 2011-01-30 23:34:54 3
  • This is an example of the usage of pdfnup (you can find it in the 'pdfjam' package). With this command you can save ink/toner and paper (and thus trees!) when you print a pdf. This tools are very configurable, and you can make also 2x2, 3x2, 2x3 layouts, and more (the limit is your fantasy and the resolution of the printer :-) You must have installed pdfjam, pdflatex, and the LaTeX pdfpages package in your box. Show Sample Output


    3
    pdfnup --nup 2x1 --frame true --landscape --outfile output.pdf input.pdf
    TetsuyO · 2010-12-21 14:20:06 5
  • Quick and dirty version. I made a version that checks if a manpage exists (but it's not a oneliner). You must have ps2pdf and of course Ghostscript installed in your box. Enhancements appreciated :-)


    59
    man -t manpage | ps2pdf - filename.pdf
    TetsuyO · 2010-12-19 22:40:18 14

What's this?

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.

Share Your Commands


Check These Out

save stderr only to a file
taken from http://www.unix.com/shell-programming-scripting/158311-how-tee-stderr.html " What does it mean? The redirection operator n>&m makes file descriptor n to be a copy of file descriptor m. So, whe are: - Opening a new file descriptor, 3, that is a copy of file descriptor 1, the standard output; - Making file descriptor 1 a copy of file descriptor 2, the standard error output; - Making file descriptor 2 to be a copy of file descriptor 3 (the "backup" of the standard output) in a short: we swapped the standard output and the standard error output. "

Get your outgoing IP address

youtube2m3u
generate playlists from youtube ( or othre things that support yt-dlp)

Read info(1) pages using 'less' instead of GNU Texinfo
I like man pages, and I like using `less(1)` as my pager. However, most GNU software keeps the manual in the 'GNU Texinfo' format, and I'm not a fan of the info(1) interface. Just give me less. This command will print out the info(1) pages, using the familiar interface of less!

save your current environment as a bunch of defaults

Monitor all DNS queries seen by the local machine

delete files containing matching text
-r recursively -Z zero byte after each file name instead of the usual newline -l only filenames

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.

Check the status of a network interface
no need for installing mii-tools, all generic tools working under archlinux.

sort lines by length


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.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

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: