Open two files side by side using vim
Answer:
If you have two files, you want to open both of them in vi/vim and edit side by side, you can do the following.
# vim -O foo.txt bar.txt
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Open two files side by side using vim
Answer:
If you have two files, you want to open both of them in vi/vim and edit side by side, you can do the following.
# vim -O foo.txt bar.txt
Setup time synchronisation in CentOS
Answer:
You can install the NTP server using yum.
# yum install ntp
And enable the services during server startup
# chkconfig --levels 235 ntpd on
# ntpdate 0.pool.ntp.org
# /etc/init.d/ntpd start
Replace text in vi with confirmation
Answer:
Similar to this article, you want to replace text, but you want to vi/vim to ask for confirmation before the actual replacements.
:%s/foo/bar/gc
Replace text in vi
Answer:
To replace a text in a file using vi/vim
Enter the command mode by typing :, and use the %s/foo/bar/g for global replacement(s).
:%s/foo/bar/g
All foo in the file will be replaced by bar
Check which Apache modules are loaded
Answer:
To check which Apache modules are loaded, in RHEL/Fedora/CentOS, type
# httpd -M
In Debian/Ubuntu
# sudo apache2ctl -M