Commands using fc-list (2)

What's this? 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

Check if you work on a virtual/physical machine in Linux
Command used to know if we are working on a virtual or physical machine. This command will use the dmidecode utility to retrieve hardware information of your computer via the BIOS. Run this command as root or with sudo.

Rename files in batch

Generate a list of items from a couple of items lists A and B, getting (B - A ) set
ItemsListtoAvoid (A) could be a list of files with a special characteristic to exclude. It can be a result of previous processing list, ex. a list of files containing a special string. AlItemsList.txt (B) Is a complete list of items including some or all items in A. $Difference is saved in ItemsDifference.txt

Remove the first character of each line in a file

grep (or anything else) many files with multiprocessor power
xargs -P N spawns up to N worker processes. -n 40 means each grep command gets up to 40 file names each on the command line.

sniff network traffic on a given interface and displays the IP addresses of the machines communicating with the current host (one IP per line)

Gets a random Futurama quote from /.

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"

Save your open windows to a file so they can be opened after you restart
This will save your open windows to a file (~/.windows). To start those applications: $ cat ~/.windows | while read line; do $line &; done Should work on any EWMH/NetWM compatible X Window Manager. If you use DWM or another Window Manager not using EWMH or NetWM try this: $ xwininfo -root -children | grep '^ ' | grep -v children | grep -v '' | sed -n 's/^ *\(0x[0-9a-f]*\) .*/\1/p' | uniq | while read line; do xprop -id $line _NET_WM_PID | sed -n 's/.* = \([0-9]*\)$/\1/p'; done | uniq -u | grep -v '^$' | while read line; do ps -o cmd= $line; done > ~/.windows

update you web
in fact, I want to know, how to only get the modified files.

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.


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: