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.

Make vim open in tabs by default (save to .profile)
I always add this to my .profile rc so I can do things like: "vim *.c" and the files are opened in tabs.

Dump snapshot of UFS2 filesystem, then gzip it
Opens a snapshot of a live UFS2 filesystem, runs dump to generate a full filesystem backup which is run through gzip. The filesystem must support snapshots and have a .snap directory in the filesystem root. To restore the backup, one can do $ zcat /path/to/adXsYz.dump.gz | restore -rf -

ram usage most top 10 process

Use tee to process a pipe with two or more processes
Tee can be used to split a pipe into multiple streams for one or more process to work it. You can add more " >()" for even more fun.

Job Control
background and disown, but with a proper one-line syntax

list files in 'hitlar' mode
Was playing with the shell. It struck to me, just by rearranging the parameters, i was able to remember what they did and in a cool way. Enter the 'hitlar' mode. bash-3.2$ ls -hitlar Shows all items with inodes, in list view, human readable size, sorted by modification time in reverse, bash-3.2$ ls -Fhitlar Shows the same with classification info. Add the hitlar mode alias to your .bashrc. bash-3.2$ echo "alias hitlar='ls -Fhitlar'" >> ~/.bashrc bash-3.2$ hitlar bash-3.2$ hitlar filename

give me back my sound card
for when a program is hogging the sound output. finds, and kills. add -9 to the end for wedged processes. add in 'grep ^program' after lsof to filter.

List symbols from a dynamic library (.so file)
You can get what functions at which addresses are inside a dynamic link library by this tool.

Display total Kb/Mb/Gb of a folder and each file


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: