When you do a ls -1 | xargs rm it wouldn't workd because those files have spaces. So you must use find -print0 and xargs -0
unzips all zip files in any subdirectory under the current directory. The zip files are unzipped in their respective subdirs
Built-in function in linux, should work on any distro Show Sample Output
cat /etc/debian_version
Doesn't create a file Make sure to list the files / directories in the same order every time.
apt-show-versions is a program that shows what packages in the system may be updated and several useful information. The -u option displays a list of upgradeable packages: From: http://www.debian.org/doc/manuals/apt-howto/ch-helpers.en.html Show Sample Output
This will show the locations, in order of preference, that MySQL will look for a configuration file Show Sample Output
Ever need to erase the contents of a file and start over from scratch? This easy command allows you to do so. Be warned! This will immediately erase all the contents of your file and start you over from scratch (i.e. your file will be at 0 bytes, like if you touch a file). Show Sample Output
But who knows to delete the rest of the lines? I want only "string".
This will get the mac address of the eth0 and change lowercase to uppercase. The sed command removed the colons.
ls -l may vary depending on operating system, so "print $8" may have to be changed
We can put this inside a function:
fxray() { curl -s http://urlxray.com/display.php?url="$1" | grep -o '<title>.*</title>' | sed 's/<title>.*--> \(.*\)<\/title>/\1/g'; };
fxray http://tinyurl.com/demo-xray
Show Sample Output
short enough to be tweetable Show Sample Output
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: