Commands by liancheng (1)

  • The Pomodoro Technique is a time management method developed by Francesco Cirillo in the late 1980s. The technique uses a timer to break down periods of work into 25-minute intervals called 'Pomodori' (from the Italian word for 'tomatoes') separated by short breaks. You need to prepare a short .wav file (the "ring.wav" in the sample command line). This command will trigger aplay to play ring.wav 25 minutes from now on, which can be used as a poor man's pomodoro timer. Show Sample Output


    0
    echo "aplay ring.wav" | at now + 25 min
    liancheng · 2013-03-22 04:27:57 7

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

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Printout a list of field numbers (awk index) from a CSV file with headers as first line.
Useful to identify the field number in big CSV files with large number of fields. The index is the reference to use in processing with commands like 'cut' or 'awk' involved.

get all Google ipv4 subnets for a iptables firewall for example
a bit shorter, parenthesis not needed but added for clarity

Show git log beautifully
Only show a short of important information inline ( include branch info ), and color this log tree.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Touch a file using a timestamp embedded in the file name.
tstouch takes two arguments: a filename containing a timestamp, and an extended regular expression with the parenthesized section matching a timestamp of the form YYYYMMDDhhmm or YYYYMMDDhhmm.ss. It then touches the file with that timestamp.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Zip each file in a directory individually with the original file name
This will list the files in a directory, then zip each one with the original filename individually. video1.wmv -> video1.zip video2.wmv -> video2.zip This was for zipping up large amounts of video files for upload on a Windows machine.

Remove a range of lines from a file
Deletes lines to of a file. You must put the end line first in the range for the curly brace expansion, otherwise it will not work properly.


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: