| |
$ ls [Enter] apple cherry orange $� ���� ������� ������� ������� ������� �������� ��� �����: `apple', `cherry', � `orange'.
����� ����������� ���������� ����������� `work' � ������� ��������, �������:
$ ls work [Enter]
����� ����������� ���������� �������� `/usr/doc', �������:
$ ls /usr/doc [Enter]
�� �������� �� ��������� �� �� ������� �������� �������� � ����������� ����� �� �������. ����������� ���� `-F', ������� �������� ls ��������� ������ `/' ����� ���� ������������ � ������ `*' ����� ���� ����������� ������:
$ ls -F [Enter] repeat* test1 test2 words/ $
� ���� ������� ������� ������� ������� �������� ����������� ���� `repeat', ������� `words', � ��������� ������ ������ ����� `test1' � `test2'.
��� ���� ������ ��������� ����������� ��������� - ������������� ``��������� ������'', ������� ��� Linux ������� ���������� �����; �������� ���������� �������� ``Midnight Commander'' ��� mc.
����� ������� ����� ��������� ������� ��������, ����������� ls � ������ `-l' (``long''). ������� ����� ��������� ������ ������� ����� � ������, ����� ��������� �����������, ��� �����, ��� ��������� � ����� �������.
��� ������ ��������� ���������� � �������� `/usr/doc/bash', �������:
$ ls -l /usr/doc/bash [Enter] total 72 -rw-r--r-- 1 root root 13744 Oct 19 22:57 CHANGES.gz -rw-r--r-- 1 root root 1816 Oct 19 22:57 COMPAT.gz -rw-r--r-- 1 root root 16398 Oct 19 22:57 FAQ.gz -rw-r--r-- 1 root root 2928 Oct 19 22:57 INTRO.gz -rw-r--r-- 1 root root 4751 Oct 19 22:57 NEWS.gz -rw-r--r-- 1 root root 1588 Oct 19 22:57 POSIX.NOTES.gz -rw-r--r-- 1 root root 2718 Oct 19 22:57 README.Debian.gz -rw-r--r-- 1 root root 19596 Oct 19 22:57 changelog.gz -rw-r--r-- 1 root root 1446 Oct 19 22:57 copyright drwxr-xr-x 9 root root 1024 Jul 25 1997 examples $������ ������ �������� ���������� � ������ ������ ����������� ��������� ��������� ������������ � ������ �� 1024 ����� (� ������ ������ 72). ������ ����������� ������ �������� ��������� ������� � ����������� � ������ �����.
������ ������� ��������� ��� ����� � ����� ������� � ����. ������ ������ � ���� ������� ���������� ��� �����; ���� (`-') �������� ������� ���� (�� ���������). �������� ������������ ������ `d', � ������������� ������ - ������ `l'. ��������� ������ �������� � ������ ������� ��������� ����� ������� � �����. ������ ������� ��������� ���������� ������� ������ �� ����. ������ � ��������� ������� ��������� ������������ � ������, ������� ������� ���� ������. ����� ������� �������� ������ ����� � ������, ������ - ����� � ���� ��������� ����������� �����, � � ��������� ������� ������� ��� �����, � �������� ��������� ����������.
����� ����������� ������� ����������, �� ���� �� ����� ������������� � ��� �������������, ����������� ����� `-R'. ��������, ��� �������� �������� �������:
$ ls -R [Enter] play work play: notes work: notes $� ������ ������� ������� ������� ������� �������� ��� �����������, `work' � `play', �� �� �������� ������. ������ �� ������������ �������� ���� `notes'.
����� ������� ������ ���������� ��� �������� �������, ��������:
$ ls -R / [Enter]
������ ���� ���� ����������� � ������ `-l', ����� ������� �������� ������ ������� ������ �������:
$ ls -lR / [Enter]
����������: ��������� �������� ����� �� ������� � �������, ���� � ��� ��� ����� ������� � ���.
����� ������������� ������ ������ � �������� �� ������� �������� ��� �����������, ����������� ����� `-t'. ��������, ����� ������� ������ ������ � �������� `/usr/tmp', ����� ����� ����� ����� ���� ������ ������, �������:
$ ls -t /usr/tmp [Enter]
�� ���������, ls �� ������� ����� ������, ������������ � ������� ``�����'' (`.'). ����� ��������� �������, ������ ���������� ``��������'' ����� ������������ � ����� �������� ��������, ���������� �� �����, ������������ � �����; ��� ���������� dot-�����, ��� ``�������''. ������ ������� ����� ��� ����������� dot-�����: `..' - ������������ ������� � `.' - ��� ���� �������.
����� ������� ��� ����� � ��������, ������� �������, ����������� ����� `-a'. ��������, ��� �������� ��������:
$ ls -a [Enter]
����� ������� ��� �����, �������� ����������� `..' � `.', ����������� ����� `'-A:
$ ls -A [Enter]
����� ������� ������� ������� ��������, ����������� ls � ������ `--color'
; ����� ��� ����� ������ ����� �������� ������� �������, � ����������� �� ��
����������. �� ��������� �������� ��������� �����, ��������� ����� - �����,
����������� - ������� � �.�.
����������: ������ ��� ������� `ls -color' ��������� ��������� `ls', ��� ��� ������� ��������� � ����� �� ���������.
��� ����, ����� ������� ���� �������� ���������, ����������� ������� tree. ��������, ��� ������ ������ ���������, ������� � ��������, ��������:
$ tree [Enter]
.
|-- projects
| |-- current
| `-- old
| |-- 1
| `-- 2
`-- trip
`-- schedule.txt
4 directories, 3 files
$
� ���� ������� ��������� ������ ���������, � ������� ������� ������� �������� ��� ����������� `projects' � `trip'; � ������� `projects', � ���� �������, �������� ����������� `current' � `old'.
����� ������� ������ ��������� ��� ������������� ��������, ������� ��� ��� � �������� ��������� tree. ��������, ��� ������ ��������� ��������, �������:
$ tree ~ [Enter]
����� ������� ������ ���������, � ������� ����� �������������� ������ ����� ���������, ����������� ����� `-d'. ��� ������� ��� ������ ������� ������ ��������� �������:
$ tree -d / > tree [Enter]
������� ls ����� ����� ����� ��� ���������� ��������� � ������������ ����������� � ������; ����������� ������� ��������� ��������� �� ���.
| ����� | �������� | |
--color |
����� ���� ������ � �����, � ����������� �� �� ����. | |
-R |
����������� ������ ������. | |
-a |
����� ���� ������, ������� �������. | |
-d |
����� ������ ���� ���������, ��� ���������� �� �����������. | |
-f |
����� ����������� �������� � ��� �������, � ������� ��� �������� �� ����. | |
-l |
��������� �������. | |
-r |
���������� ����������� �������� � �������� �������. | |
-s |
����� ������� - � ������ �� 1K - ��� ������� �����. | |
-t |
���������� �� ������� �������� ��� ����������� �����. |
����������: �� ������ ������������� ����� � ����� �������; ��������, ����� ������� ������ ������, ��������������� �� �������, �� ����� ����������, ������� `-lt'. ����� ���������� ���������� ��� ������� ����� � �� ��������, ����������� `-lRa'. ������� ����� �� ����� ��������, ��� ��� `-lRa' �������� �� �� �����, ��� � `-alR'.