All commands (14,187)

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

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

List dot-files and dirs, but not . or ..

Show URL/text in clipboard as QR code
Copy a URL (or Thai text, or whatever) and hit the keyboard shortcut for this fu to display it as a QR code. It's an "air gapped" way to send stuff to your phone [unlike google chart API etc.] as long as you watch out for cameras ;). dependencies [sudo apt-get install]: qrencode xclip xloadimage

Find files containing string and open in vim
I often use "vim -p" to open in tabs rather than buffers.

Steve Reich - Piano Phase; interpreter: Bourne-Again Shell.
The Piano Phase piece, by Steve Reich is a minimalist composition which is played on two pianos played at slightly different tempos, a task that's very difficult to accomplish by human players. The auditive effects produced by the cell displacement produce beautiful patterns. See https://en.wikipedia.org/wiki/Piano_Phase . My rendered version: https://ydor.org/SteveReich/piano_phase.mp3 Requires sox to be installed on the system. There are multiple videos on youtube showing different approaches and experiences to this interpretation. There is also a synthesized version. Even if Bash can behave as a powerful pianist, a simple threaded version leaves full room to several time glitches and even negative displacements, the same issues that human pianists experience when playing the piece. The older the computer, the better the chaos added to the result due to the CPU load. Apparently that's the reason Steve Reich composes pieces such as this. Without further ado, please give a warm welcome to the Bash minimalist player on synthesized two-threaded pianos. Please turn off your cellphones.

Show which programs are listening on TCP and UDP ports
-p Tell me the name of the program and it's PID -l that is listening -u on a UDP port. -n Give me numeric IP addresses (don't resolve them) -t oh, also TCP ports

exec chmod to subfiles
Using `-exec cmd {} +` causes find to build the command using all matching filenames before execution, rather than once per file.

Quick syntax highlighting with multiple output formats
You can specify various output formats, theme styles, etc. $ python -m pygments -o source.png source.py $ python -m pygments -o source.rtf source.py Check available output formats, styles, etc.: $ python -m pygments -L Find pygments module here: http://pygments.org/

Make a DVD ISO Image from a VIDEO_TS folder on MacOSX
/path/ is the root folder of the DVD, not the VIDEO_TS folder.

dont log current session to history


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: