7.5. ����� ������ � ���������� � �������

[+]7.5.1. whatis(1)
[+]7.5.2. whereis(1), which(1)
[+]7.5.3. locate(1)
[+]7.5.4. find(1)
[+]7.5.5. sh type

��������:� �������� BSDA ������ ����� ������ ����� ��� ��������� ������ ���� � ����� ����� ������� ����� ��� ����������� ����������, �������� �����, ������� man � ������. �������� ������ ����� �������� ���� ������ locate(1)

��������:�whatis(1), whereis(1), which(1), locate(1), find(1), sh(1) ������� ���������� ������� type � ����� -v-V, locate.updatedb(8), locate.conf(5).

�����������

7.5.1. whatis(1)

������� whatis(1) ���� ������� �������� ��������� � ��������� ��������������� ���� ������. ���� ������ ��������� �������� makewhatis. ��� ������� �� �����, ���������� ��� ��, ��� � ���� ���� man: */man/whatis. ������ ��� �������� ��� � ������ ��� ������ ������ cron (� DragonFly�BSDFreeBSD ��� ������ ������� �� ������� periodic, � OpenBSD ��� ������ /etc/weekly).

$ whatis grep
grep(1), egrep(1), fgrep(1), zgrep(1), zegrep(1), zfgrep(1), bzgrep(1), bzegrep(1),
bzfgrep(1) - print lines matching a pattern
        

7.5.2. whereis(1), which(1)

������� whereis(1)FreeBSDDragonFly�BSD ���� ������������ ��������� �����, ��������������� ��� �������� man � ������������ �������� � �������� ����� ��� ���� ���������.

$ whereis grep
grep: /usr/bin/grep /usr/share/man/man1/grep.1.gz /usr/src/gnu/usr.bin/grep
        

OpenBSDNetBSD whereis(1) ����� ��������� � �������� ������ � ������������ ����������� �����. ����� �������, � ���� �������� ��� �� �������� �� ������� which(1).

7.5.3. locate(1)

������� locate(1) ��������� ������ ����� � ��������������� ���� ������. ����� � ����� ���� �������������� ����������� ���������, ��� �������� ������� �������� ������� locate(1) �� ������� find(1). ������ ���� ������ locate ��������� � ���������� ����������. ����� ��������� ������ ���� ������� ����� ��������� ������������. ������ ���������� ���� locate �������������� ����� ����� cron, ��� � ���������� ���� whatis. � DragonFly�BSDFreeBSD ��� ������� ������������ � ������ ����� periodic(1) weekly, � OpenBSD � � NetBSD � ������� /etc/weekly.

���������� ���� ������ �� ���� �������� BSD ������������ ���������� locate.updatedb(8) ����������� �� ������ /usr/libexec/locate.updatedb. ���������������� ���� ���� ��������� � DragonFly�BSD, FreeBSDOpenBSD�— /etc/locate.rc. � NetBSD�— /etc/locate.conf.

������ ������� locate.updatedb(8) � ������� root �� ������ ����. � ���� ������ � ���� ������ locate(1)�— /var/db/locate.database ����ģ� ��� ���������� � �������� �������, � ������������� ������ �������� ���������� � ������� ���������, �� ������� � ���� ��� ���� ������. ������ ������� locate.updatedb(8) ��������� �� ������������ nobody, ���� � ��� ���� ��������, ���������� ��� ��� ������� � �������� ���������� ����� cron. � FreeBSD ����� ��������� ������� /etc/periodic/weekly/310.locate.

7.5.4. find(1)

������� find(1) ���� ������������� ��� ������ ������, ������ ���, � ������� �� locate, ������������ �������� ����� � �������, � �� ����������� � ���� ������. �������� ���, �������, ����������� ���������, ������ ţ ����������� ����������� ������. ��������� ��� ����� ������� ���� (��. �����̚7.6, «����� ����� �� �������� ���������»).

7.5.5. sh type

�� ��� ������� ���������� ��� ������ ��������� ��� ����������. ���� �ݣ ���������� ������� ��������, ������̣���� �������. ���, ��������, �� ������� which�alias �� ������ ��������� �������� ���� /usr/bin/alias. �� �� ����� ����, alias ��� ���������� �������, ��� � sh(1), ��� � � csh(1). ����� �������� ���������� ������� �� ������� ���������� ������� type. ��� �� ������� ��� ���������� �� �������� �� ������������ ���� ������� ���������� alias'�� (�����������).

$ type alias
alias is a shell builtin
$ type grep
grep is /usr/bin/grep
$ type ls
ls is aliased to `ls -GF'
        

csh ������� type ���.