This command can be used with xclip or xsel for use on a linux box. Show Sample Output
If you've ever wanted to change a text files contents without having to create an intermediate file. This is it. Ex is a part of vim. The command as given will delete ALL lines containing "delete this line" from the file. More Examples: print '%s/'this is a line'/'that is not the same line'/g\nwq' | ex file.txt will substitute the first string with the second string. print '3a\n'Inserted Line'\n.\n\nwq' | ex file.txt will insert the given line after line 3. CAVEAT, Some distro's like the print command, others like echo with this command. Also note there are NO error messages on failure, at least that I've ever seen. Ex can also be quite fussy as to how it takes strings, parameters, etc... I use at&t's ksh syntax may very with other shells.
It is not uncommon to receive an error "Too many open files", this command allows you to change the limit for a user. This can be put into /etc/profile so that all users will have this change.
If your XML is appended to a line with a time stamp or other leading text irrelevant to the XML, then you can append a s/foo/bar/ command, like this:
sed -n /<Tag>/,/<\/Tag>/p; s/.*\(<Tag.*\)/\1/' logfile.log
There's already a proper command for what the former alternative tried to script
Well this can come handy , when you don't feel like playing with pid rather if you know the process name say "firefox",it would kill it.The script given below would kill the process with its name given as first parameter , though not robust enough to notify that process doesn't exist , well if you know what you are doing that's wouldn't be a problem.:) ---- killhim.sh ---- #!/bin/bash ps -u $USER |grep $1 | awk '{ print $1}'| xargs kill ----
This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000) Enjoy!
This set of commands will rip a dvd title using a 2 pass mencoder xvid encode. It will provide a great quality rip. It will rip as close to 700MB as possible. (note the bitrate of -700000) Enjoy!
Requires Linux Remind: http://www.roaringpenguin.com/products/remind and Growl on the Mac: http://growl.info/ growlnotify needs to be in the executable path on the mac. Combined with "prowl" in the iPhone you can receive push notifications of your reminders to the iPhone.
the f is for file and - stdout, This way little shorter. I Like copy-directory function It does the job but looks like SH**, and this doesn't understand folders with whitespaces and can only handle full path, but otherwise fine, function copy-directory () { ; FrDir="$(echo $1 | sed 's:/: :g' | awk '/ / {print $NF}')" ; SiZe="$(du -sb $1 | awk '{print $1}')" ; (cd $1 ; cd .. ; tar c $FrDir/ )|pv -s $SiZe|(cd $2 ; tar x ) ; } Show Sample Output
Create a single tar.gz archive I know it's a very basic one, but it's one I keep forgetting. Show Sample Output
To ensure that it will never come back, you can edit /etc/modprobe.d/blacklist Add "blacklist pcspkr" sans quotes
short command to find a string in all text files in all subdirectories, excluding all files grep does not deem text files.
Also useful with iostat, or pretty much anything else you want timestamped. 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: