Упражнение 4
- выполнил команду cd;
# cd
- создал директорий proba;
# mkdir proba
- переместил в созданный директорий файл list;
# mv list.txt proba
- перешол в директорий proba;
# cd proba
- подсчитал количество байт, слов и строк в файле list;
# wc list.txt
0 0 0 list.txt
- командой diff сравнил файлы list и list2;
# diff list.txt list2.txt
1c1
< text list
\ No newline at end of file
---
> text list2
\ No newline at end of file
- переименовал файл list2 в файл list3;
# mv list2.txt list3.txt
- удалил файлы list, list3;
# rm list.txt list3.txt
- удалил директорий /proba;
# cd
# rmdir proba
- удалил файл list в текущем директории;
# rm list.txt
- вывел на экран описание для утилиты use;
# use
Program name missing; use
use [-ai] progname
# use use
use - print a usage message (QNX)
use [-a] [-d <directory>] [-e] [-f <filelist>] [-i] files
Options:
-a Extracts all usage information from the load module in its source
form, suitable for piping into usemsg.
-d Recursively display info for all files under <directory>.
-e Only consider ELF files.
-f Read list of files, one per line, from file <filelist>, displaying
usage info for each.
-i Displays information from load module (ELF only).
-s Displays .ident strings (ELF only).
-r Displays information about running process and libraries (native only).
Where:
files A list of executable load modules or shell scripts that contain
usage messages (see printed documentation for use and usemsg
for details).
- вывел на экран описание команды ls, записал значение опций -с, -D, -F -1, -v, -s;
# use ls
ls - list directory contents (POSIX)
ls [-1CFRacdilqrstu] [-DSbfghnopvx] [file ...]
Options:
-1 Force output to be one entry per line.
-C Multi column output.
-D List directories only.
-F Display '/' after directories, '*' after executables, '|' after FIFOs, @
after symlinks.
-s Display the number of file system bytes in units of 512.
-v List directories first.
- выполнил команду ls с каждой из перечисленных опций;
# ls -c
. .lastlogin .profile list2.txt
.. .ph list.txt list3.txt
# ls -D
. .. .ph
# ls -F
./ .lastlogin .profile list2.txt
../ .ph/ list.txt list3.txt
# ls -1
.
..
.lastlogin
.ph
.profile
list.txt
list2.txt
list3.txt
# ls -v
. .ph .profile list2.txt
.. .lastlogin list.txt list3.txt
# ls -s
total 25
8 . 8 .ph 0 list2.txt
8 .. 1 .profile 0 list3.txt
0 .lastlogin 0 list.txt
- вывел на экран описание команды who;
# use who
who - display logged in users
Usage:
who [<file>] Print list of all logged in users. If <file> is not
specified, /var/log/utmp is used.
who am I Print the terminals you are logged into.
- выполнил команду who с опциями –i, –m.
# who -i
who: -i: No such file or directory
# who -m
who: -m: No such file or directory
#