1.4 KiB
1.4 KiB
Linux+ 1.5.4: Text editors
Vim's basic moves on a real file, a change in nano, and your preferred
editor for programs such as crontab -e.
Before you start
The lab removes /tmp/s.conf if it's there, and notes the startup files
task 4 may change so that reset can put them back. Ubuntu empties /tmp at
boot, so do task 2 without a reboot.
On the RHEL family, install full Vim and nano first. A minimal or cloud
install has only vi:
dnf install -y vim-enhanced nano
Reset removes them again if they weren't installed when the lab started.
Tasks
- Run
vimtutorand work through lessons 1 and 2 (about 15 minutes). Not graded. - Copy
/etc/ssh/sshd_configto/tmp/s.confand open it in Vim. Turn on line numbers, jump to the first line withPort, copy it, paste it below, and change the copy toPort 2222. Replace everyyeswithYES, undo that, and save and quit. - Make the same kind of change to
/tmp/s.confin nano, then quit without saving. Not graded. - Set your preferred editor for good (with
EDITORorVISUALin a shell startup file, or withselect-editoron Ubuntu), and try it withcrontab -e; quit without saving.
Hints
:set number,/Port,yy,p,cworC,:%s/yes/YES/g,u,:wq.- In nano,
Ctrl+xthennquits without saving. export EDITOR=nanoin~/.bashrc;crontab -ereadsVISUAL, thenEDITOR.