This command is useful when you are programming, for example.
This function uses xmllint to evaluate xpaths. Usage: xpath /path/to/element XMLfile
Use it with cat and '|' for know what is used in a conf file. For example cat /etc/squid/squid.conf | sed -re '/^#/d ; s/#.*$// ; /^\s$/d' : Show you what you use in your file conf. It removes all comments and empty lines. Empty lines are lines with nothing, a tab, or a space.
This permit to convert an UNIX file to DOS file. You can use it in a loop to convert multiple files, like : for i in *.bat; do sed -i 's/$/\r/' $i; done
speaks out last twitter update using 'say'
Put in your path (.bashrc or similar). Then instead of running '$ git-commit -m ' use '$ git-random'
Uses Unicode combining characters to produce strikethrough effect. Since commandlinefu doesn't display Unicode properly, you will need to replace the dash in the code above with the Unicode long stroke overlay (U+0336).
Handles the color codes intended for 256-color terminals (such as xterm-(256)color and urxvt-unicode-256color), in addition to the standard 16-color ANSI forms. Overkill for strict ANSI output, see other options for something simpler.
Change "santa+monica,ca" to your city name and state, or city name and country. In the USA, you can also use your zip code. In other countries, try using your postal code and country code. Show Sample Output
Use meaningful exit codes change "source" to "cat" to view output instead of assigning Show Sample Output
There can be more than one trailing slash, all of them will be removed.
I don't think it's possible to give a (background) colour to the tab itself, since a tab is, IIUC, simply a command to the terminal to move to the right. Nevertheless, this "highlighting" can be helpful when working with tab-separated files. Show Sample Output
Can't see it here, but the non-breaking space is highlighted :)
Of course,
cat -t -e
achieves something similar, but less colourful.
Could add more code points from https://en.wikipedia.org/wiki/Space_%28punctuation%29#Spaces_in_Unicode
Show Sample Output
This command should be copy-pasted in Windows, but very similar one will work on Linux. It uses wget and sed.
Given a dump.sql file, extract table1 creation and data commands. table2 is the one following table1 in the dump file. You can also use the same idea to extract several consecutive tables.
In these command i use lynx to get the top trend topic of Mexico, if you replace Mexico with other country, you will get the #1 Trending topic
Quickly remove the conflicting line (key) from current users known_hosts file when there is an SSH host conflict. Very nice when you get tired of writing out full commands. Ideally you would place this into your .bash_profile Usage: rhost [n] Example: rhost 33 (removes line 33 from ~/.ssh/known_hosts) Function assumes the $HOME exists, you could alternatively use "~/.ssh/known_hosts" Mac OSX likes a space for sed -i "$1" d
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: