Skip to content
Advertisement

Bash replacing text in file

I want to automate changes in a File. For example ;max_input_vars = to max_input_vars = 10000 in /etc/php5/cli/php.ini with a script.

How can I do that? I know command sed will do something like that.

Advertisement

Answer

Try this command:

sed -i -r 's/max_input_vars=.*/max_input_vars=10000/' /etc/php5/cli/php.ini
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement