Commands by c0de (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

Bash alias for creating screen session containing IRSSI, named irssi, while checking if existing session is created
Bash alias for easy irssi within screen, attempts to attach to existing irssi session, if one exists, otherwise creates one - Including wipe for when system reboots and leaves "dead" session.

Find files with the same names in several directories.
cat file1 file2 file3|sort|uniq -d finds the same lines in several files, especially in files with lists of files.

show current directory
Opens a file or URL in the user's preferred application.

Clean all .pyc files from current project. It cleans all the files recursively.

Say something out loud
Whatever arguments you pass will be spoken out loud. (Put it in a script or shell function.)

Android PNG screenshot
Works with *rooted* Android devices. 400x800 are the screen dimensions of a typical handheld smartphone.

Create Bash script to change modification time of files
Create a bash script to change the modification time for each file in 'files.txt' such that they are in the same order as in 'files.txt' File name for bash script specified by variable, 'scriptName'. It is made an executable once writing into it has been completed.

Monitor bandwidth by pid
Nethogs is a useful tool for monitor bandwidth consumption by pid. Tested on Debian an CentOs

seq (argc=2) for FreeBSD

JSON processing with Python
Validates and pretty-prints the content fetched from the URL.


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: