Commands by arighi (1)

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

Display the top 10 running processes - sorted by memory usage
A pretty nice display of processes.

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"

Recursive cat - concatenate files (filtered by extension) across multiple subdirectories into one file
Useful if you have to put together multiple files into one and they are scattered across subdirectories. For example: You need to combine all .sql files into one .sql file that would be sent to DBAs as a batch script. You do get a warning if you create a file by the same extension as the ones your searching for. find . -type f -name *.sql -exec cat {} > BatchFile.txt \;

find previously entered commands
Searches bash-history in reverse order (last entered commands first). Pressing ctrl+r again shows the next matching entry.

Convert all JPEG images to MP4
Source: http://superuser.com/a/624574

Check the package is installed or not. There will show the package name which is installed.
The ^python$ is a package name patten. You can change whatever you want.

Search files with js declarations inside
Useful to crawl where the javascript is declared, and extract it a common file. You can redirect it to a file to review item by item.

List status of your git repos and let us know if there is any new files to commit.
Source: http://www.bashoneliners.com/oneliners/oneliner/225/

Remove comments in XML file
In Redhat, xmlstarlet is called just xml which can be found in xmlstarlet RPM.

Re-read partition table on specified device without rebooting system (here /dev/sda).


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: