Using sed command to search and replace IP address
" If your version of sed supports extended regular expressions (the -r option), you could do something like this (which is similar to what you have in your grep statement). Also note $newip is outside the single quotes to allow the shell to replace it.
sed -r 's/(\b[0-9]{1,3}\.){3}[0-9]{1,3}\b'/$newip/
BTW this solution still matches strings that do not represent IP addresses. See this site under IP Adresses for more complex solutions."
มีข้อเสียคือมัน replace pattern เลข.เลข.เลข.เลข ไม่ได้สนใจว่าเป็น IP address ที่ถูกต้องหรือไม่
from: StackOverflow using-sed-to-search-and-replace-an-ip-address-in-a-file
แสดงบทความที่มีป้ายกำกับ command-line แสดงบทความทั้งหมด
แสดงบทความที่มีป้ายกำกับ command-line แสดงบทความทั้งหมด
วันอังคาร, กรกฎาคม 26, 2554
วันศุกร์, กุมภาพันธ์ 25, 2554
Free Up memory in Ubuntu
HOWTO free Up memory in Ubuntu
When you close almost every application but information from 'free' command still report a hugh number of memory consumed. Try this method ;)
echo 3 > /proc/sys/vm/drop_caches
I'm don't know much in detail which this caches was but following command line do free up memory; there're more free memory from the free's report now
When you close almost every application but information from 'free' command still report a hugh number of memory consumed. Try this method ;)
echo 3 > /proc/sys/vm/drop_caches
I'm don't know much in detail which this caches was but following command line do free up memory; there're more free memory from the free's report now
สมัครสมาชิก:
บทความ
(
Atom
)