Lesson 03 Essential File Management Tools
Lesson 03 Essential File Management Tools
Management Tools
Created @December 7, 2021 9:01 AM
Class
Type
Materials
Reviewed
# locate useradd
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
# locate useradd
/etc/default/useradd
/usr/sbin/luseradd
/usr/sbin/useradd
/usr/share/bash-completion/completions/luseradd
/usr/share/bash-completion/completions/useradd
/usr/share/man/de/man8/useradd.8.gz
/usr/share/man/fr/man8/useradd.8.gz
/usr/share/man/id/man8/useradd.8.gz
/usr/share/man/it/man8/useradd.8.gz
/usr/share/man/ja/man8/useradd.8.gz
/usr/share/man/man1/luseradd.1.gz
/usr/share/man/man8/useradd.8.gz
/usr/share/man/ru/man8/useradd.8.gz
/usr/share/man/tr/man8/useradd.8.gz
/usr/share/man/zh_CN/man8/useradd.8.gz
/usr/share/man/zh_TW/man8/useradd.8.gz
3.3 mount
To access a device, it must be connected to a directory (mounting the device).
Security
Manageability
3.4 Links
Links are pointers to files in different locations.
links are useful to make the same file available on different locations.
# ls -il /etc/hosts
17353158 -rw-r--r--. 1 root root 158 Sep 10 2018 /etc/hosts
// Hard Links
# ln /etc/hosts /root/hardhosts // hard link
# ls -il /etc/hosts /root/hardhosts
17353158 -rw-r--r--. 2 root root 158 Sep 10 2018 /etc/hosts // same inode
17353158 -rw-r--r--. 2 root root 158 Sep 10 2018 /root/hardhosts // same inode
// Symbolic Links
# ln -s /etc/hosts symhosts //
Symbolic link
# ls -il /etc/hosts /root/hardhosts /root/symhosts
//Original file
17353158 -rw-r--r--. 2 root root 158 Sep 10 2018 /etc/hosts
//hard link//1-same inode//2-date as the original file
17353158 -rw-r--r--. 2 root root 158 Sep 10 2018 /root/hardhosts
//Symbolic link//1-different inode//2-date is link creation time//3-Size is differ
ent, only 10 Bytes//4-Permissions are completely open (but the effective permissions a
re on the original file).
# ls
anaconda-ks.cfg hardhosts initial-setup-ks.cfg symhosts // red means Broken Lin
k
💡 an absolute path specifies the location from the root directory, whereas
relative path is related to the current directory.
Compressed Files
gzip // gunzip
bzip2
zip
xz
gzip --help
gzip mytar.tar // it will be gzip.tar.gz // mytar.tar will not be their anymo
re
gunzip mytar.tar.gz // uncompress, the result mytar.tar // .gz will not be their a
nymore
gunzip -k mytar.tar.gz // -k to keep the original file
bzip2 --help
bzip2 -k mytar.tar // -k to keep the original file // the result mytar.tar.bz2
xz --help
xz -k mytar.tar // -k to keep the original file // slower, and higher compressi
on ration