976 B
976 B
RHCSA 1.5: Files, directories and links
Creating a directory tree in one command, copying with everything kept, hard and symbolic links, and editing a file with vi.
Before you start
The lab saves /etc/motd and puts it back on reset. It removes
/root/skel-backup, /root/hosts-hard and /root/hosts-soft if they
exist.
Tasks
- Create the directories
/data/web/htmland/data/web/logsin one command. - Copy
/etc/skelto/root/skel-backup, keeping permissions, ownership and timestamps, including the hidden files. - Create a hard link
/root/hosts-hardto/etc/hostsand a symbolic link/root/hosts-softto it. - Using vi, add the line
Authorized users onlyat the end of/etc/motd, then quit.
Hints
mkdir -pand brace expansion:{html,logs}.cp -a;ls -lashows the dot files and dates.ln,ln -s;ls -lishows inode numbers.Ggoes to the last line,oopens a line below it, Esc, then:wq.