List all fonts used by an SVG file. Useful to find out which fonts you need to have installed in order to open/edit an SVG file appropriately. Show Sample Output
Useful for when you find the system runs out of file descriptors and you want to know why. Show Sample Output
This approach deals with special characters such as apostrophe and whitespace in the file/directory names. tr '\n' '\0' converts the newline delimiting into NUL delimitering which xargs -0 expects. It works on systems which do not yet support xargs -d or sort -h, and includes files in addition to directories. Show Sample Output
Way more easy to understand for naive user. Just returns the biggest file with size.
Show top apps that use internet, sorted by count connections and grouped by TYPE and Protocol Show Sample Output
Show what the process are opening many many file descriptos now, we can analyze this for the reason why server is worked slowly. Show Sample Output
This is much easier to parse and do something else with (eg: automagically create ZFS vols) than anything else I've found. It also helps me keep track of which disks are which, for example, when I want to replace a disk, or image headers in different scenarios. Being able to match a disk to the kernels mapping of said drive the disks serial number is very helpful
ls -l /dev/disk/by-id
Normal `ls` command to list contents of /dev/disk/by-id
grep -v "wwn-"
Perform an inverse search - that is, only output non-matches to the pattern 'wwn-'
egrep "[a-zA-Z]{3}$"
A regex grep, looking for three letters and the end of a line (to filter out fluff)
sed 's/\.\.\/\.\.\///'
Utilize sed (stream editor) to remove all occurrences of "../../"
sed -E 's/.*[0-9]{2}:[0-9]{2}\s//'
Strip out all user and permission fluff. The -E option lets us use extended (modern) regex notation (larger control set)
sed -E 's/->\ //'
Strip out ascii arrows "-> "
sort -k2
Sort the resulting information alphabetically, on column 2 (the disk letters)
awk '{print $2,$1}'
Swap the order of the columns so it's easier to read/utilize output from
sed 's/\s/\t/'
Replace the space between the two columns with a tab character, making the output more friendly
For large ZFS pools, this made creating my vdevs immeasurably easy. By keeping track of which disks were in which slot (spreadsheet) via their serial numbers, I was able to then create my vols simply by copying and pasting the full output of the disk (not the letter) and pasting it into my command. Thereby allowing me to know exactly which disk, in which slot, was going into the vdev. Example command below.
zpool create tank raidz2 -o ashift=12 ata-... ata-... ata-... ata-... ata-... ata-...
Show Sample Output
For all users of https://addons.mozilla.org/de/firefox/addon/speed-dial/
If you want to create new user accounts in OS X from the command line use this fragment to find the next free user id. In OS X CLI you have to assign the user id yourself Show Sample Output
How to Free Inode Usage Show Sample Output
list the file size of files in a directory from largest to smallest. Good for finding whats taking up all your harddrive space.
This command summarizes the disk usage across the files and folders in a given directory, including hidden files and folders beginning with ".", but excluding the directories "." and ".." It produces a sorted list with the largest files and folders at the bottom of the list Show Sample Output
Uses "locate" instead of "find", "sort -u" instead of "sort | uniq" and it's case insensitive. 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: