Answer the question
In order to leave comments, you need to log in
How to add an entry to a file?
Good afternoon, tell me how to add an entry to a file from the terminal?
For example, such a condition
Add
192.168.1.1 after the line IPADDR=
255.255.255.0 after NETMASK=
What would the condition look for, if there is, it should add a value, if not, then + parameters and value.
Answer the question
In order to leave comments, you need to log in
1. > vim ./file
2. > /IPADDR (поиск) (нажать / и ввести строку, нажать enter)
3. > f=
4. > a (insert mode) (нажать а)
5. > 192.168.1.1
6. > esc (нажать ESC)
7. > /NETMASK
8. > шаг 3 и 4
9. > 255.255.255.0
10. > esc
11. > :wq (сохранить и закрыть) (нажать : и ввести 2 буквы)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question