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

Count opening and closing braces in a string.
This function counts the opening and closing braces in a string. This is useful if you have eg long boolean expressions with many braces and you simply want to check if you didn't forget to close one.

Copy via tar pipe while preserving file permissions (cp does not!; run this command with root!)
cp options: -p will preserve the file mode, ownership, and timestamps -r will copy files recursively also, if you want to keep symlinks in addition to the above: use the -a/--archive option

Set OS X X11 to use installed Mathematica fonts

list block devices
Shows all block devices in a tree with descruptions of what they are.

calulate established tcp connection of local machine
If you want prepend/append text just wrap in echo: $echo Connected: `netstat -an|grep -ci "tcp.*established"`

Install a new kernel in Manjaro linux
00 is the number of the linux kernel e.g. linux39

retrieve the source address used to contact a given host
on multihomed hosts, connected to several networks, could be usefull to know the source address (local ip address) used to reach the target host, this command does not require root priviledges. The command use a TCP socket, if there is any error the command return an empty string, elsewhere return a valid ip address.

Convert diff output to HTML ins/del

For a $FILE, extracts the path, filename, filename without extension and extension.
Useful for use in other scripts for renaming, testing for extensions, etc.

Calculate your total world compile time. (Gentoo Distros)
From Gentoo Forum, greetings to rudregues & steveL.


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: