2021 example
find . -type f -iname *.html | xargs grep -i johnmeister
(the line above prints out file names!)
-----------------------------------------------------------------------------
(If you use find with grep as below, it doesn't list file name:
find . -type f -exec grep -i johnmeister {} \;
-----------------------------------------------------------------------------
--> find . -type f -iname HEADER.html | xargs grep -i johnmeister
./BOOKS-ENGLISH-KJV/HEADER.html: johnmeister.com
./BOOKS-FRENCH-LSG/HEADER.html: johnmeister.com
./BOOKS-GERMAN-LUTH1545/HEADER.html: johnmeister.com
./BOOKS-GREEK-LXX-Koine-NT/HEADER.html: johnmeister.com
--> find . -type f -iname *.html | xargs grep -i johnmeister
--> find . -type f -iname *.html | xargs grep -i bibletech.net | wc -l
51
--> find . -type f -iname '*.txt' | xargs grep -i HARDENT
------------------------------------------------
--> find . -type f -iname '*.html' | xargs grep -i HARDENT
------------------------------------------------
--> perl -pi -e 's/HARDENT/HARDEN/g' *.txt
# better to grab the list of files and the edit them each, when using perl it touches ALL the files so if you
do an rsync you'll be recopying files with new dates...
xarg examples
ymmv - check your local man pages for syntax and options
In trying to determine how to kill off processes created by an application
quickly, I came up with the following command that seems to work...
BEFORE using xargs to kill an application, test it as follows
ps -ef | grep ptc
ps -ef | grep ptc | xargs echo `awk '{print $2 }'`
verify that the pid's listed in the first command match the pid's in the second.
If more shows up then the specific application, then you want to be more specific,
test until only the processes you wish to terminate are listed.
the use of xargs with the kill command
to kill off all processes associated with "ptc":
ps -ef | grep ptc | xargs kill -9 `awk '{print $2 }'`
to kill off all processes associated with "oli":
ps -ef | grep oli | xargs kill -9 `awk '{print $2 }'`
to kill off all processes associated with "etscape":
ps -ef | grep etscape | xargs kill -9 `awk '{print $2 }'`
xargs
USING xargs in a korn shell with Services for UNIX.
according to http://www.linux.com/article.pl?sid=04/04/13/211209 one should use the -n1 option,
this should feed one input at a time... however, it didn't work in SFU 3.5.
find /dev/fs/H/ARCHIVE/ -type f -name *.jpg -print | xargs -nl -i cp {} /dev/fs/H/ALL-PIX
WHAT WORKED:
find /dev/fs/H/ARCHIVE/ -type f -name *.jpg -print | xargs -i cp {} /dev/fs/H/ALL-PIX
JohnMeister.com
Today's Date:
|