Professional Documents
Culture Documents
Chapter14
Chapter14
Notes:
- We can't umount a busy file system.
- Removable media, get automatically mounted under /run/media/<user>/<label>
- Removing a USB storage device without unmounting the file system on it can result
in data loss.
===================================================
Making Links Between Files:
[root@master ~]# ln file.txt /demo.txt (creates a hard link)
[root@master ~]# ls -li file.txt /demo.txt (the same inode number)
Notes:
- After a new hard link is created, there is no way to tell which of the existing
hard links is the original one.
- All hard links referencing the same file have the same permissions, link count,
user/group ownerships, time stamps, and file content. If any of that information is
changed on one hard link, all other hard links pointing at the same file will show
the new information as well.
- hard link is not allowed for a directory.
- In RHEL7, a normal user can create a hard link to files that he has permissions
on.
- Hard links must exist on the same file system.
- A symbolic link can point to a file on a different file system.
- When creating the symbolic link, the full path should be used.
===================================================
Locating Files on the System:
[root@master ~]# locate passwd
[root@master ~]# locate -i messages (case-insensitive search)
[root@master ~]# locate -n 5 passwd (the first five matches)
[root@master ~]# locate passwd | grep -i passwd
[root@master ~]# updatedb (the default is 1 day)