Linux : these script enable you to edit multiple files and remove exact phrase from multiple files
This will, for an application that has already been removed but had its configuration left behind, purge that configuration from the system. To test it out first, you can remove the last -y, and it will show you what it will purge without actually doing it. I mean it never hurts to check first, "just in case." ;)
Find and kill multiple instances of a process with one simple command.
it recursively searches your project's directories and sum the lines of every source [.c or .h]. Then it gives you the total.
Original submitter's command spawns a "grep" process for every file found. Mine spawns one grep with a long list of all matching files to search in. Learn xargs, everyone! It's a very powerful and always available tool.
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
After this command you can review doit.sh file before executing it. If it looks good, execute: `. doit.sh`
Will search recursively and output the searchResult.txt in the same folder you are located.
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 ----
root@wow/var/spool/clientmqueue # rm spam-* /bin/rm: Argument list too long.
if Argument list too long
# define user pid to kill PID=httpd ; # kill all pids ps aux | grep $PID | grep -v grep | awk '{print $2}' | xargs kill -9 Show Sample Output
Did some research and found the previous command wrong, we don't kill a zombie but its parent. Just made some modifcation to khashmeshab's command.
Watches for file modifications in the current directory and tails the file.
xargs will automatically determine how namy args are too many and only pass a reasonable number of them at a time. In the example, 500,002 file names were split across 26 instantiations of the command "echo". Show Sample Output
One liner is based on this article: https://www.computerhope.com/issues/ch001307.htm 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: