i have a question:
How can i edit a file (e.g. php.ini) without opening it with editor? I can only use one command via SSH/SOAP so i tried to remove the file and write it new but this is slow and doesn't work well.
for example i want to edit this post_max_size = 8M
to post_max_size = 32M
with one single command. Is that possible?
Stream edit - also known as "sed" is your friend.
sed 's/post_max_size = 8M/post_max_size = 32M/' infile > outfile
sed -i 's/post_max_size = 8M/post_max_size = 32M/' inplace_file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With