Unix - Hour 1

What is this UNIX Stuff?

 

1.1 Man Pages, Unix Online Reference

1.1.1 Displays detailed information about the command mkdir. This command is used to create new directories.

internet% man mkdir

Reformatting page. Wait... done

User Commands mkdir(1)

NAME
mkdir - make directories

SYNOPSIS
mkdir [ -m mode ] [ -p ] dir ...

DESCRIPTION
The mkdir command creates the named directories in mode 777
(possibly altered by the file mode creation mask umask(1)).

Standard entries in a directory (for instance, the files
".", for the directory itself, and "..", for its parent) are
made automatically. mkdir cannot create these entries by
name. Creation of a directory requires write permission in
the parent directory.

The owner-ID and group-ID of the new directories are set to
the process's effective user-ID and group-ID, respectively.
mkdir calls the mkdir(2) system call.
--More--(23%)



1.1.2 Produced same result presented above once we are working under Sun Solaris 5.7 at GGU.


1.1.3 Could not execute command apropos. This command is available on most unix systems and is often just an alias to
man -k . However this command is not available at GGU SunOS 5.7.


internet% apropos floppy
/usr/share/man/windex: No such file or directory
/usr/local/man/windex: No such file or directory
/usr/openwin/man/windex: No such file or directory
/opt/hpnpl/man/windex: No such file or directory

internet% man -k
usage: man [-] [-adFlrt] [-M path] [-T macro-package ] [ -s section ] name ...
man [-M path] -k keyword ...
man [-M path] -f file ...


1.1.4 The command whathis also did not work at GGU SunOS 5.7and produced the following results.

internet% whatis whatis
/usr/share/man/windex: No such file or directory
/usr/local/man/windex: No such file or directory
/usr/openwin/man/windex: No such file or directory
/opt/hpnpl/man/windex: No such file or directory


1.1.5 The following command also did not work and produced the following results.

internet% alias apropos "man -k \!* | uniq"
internet% apropos cd
/usr/share/man/windex: No such file or directory
/usr/local/man/windex: No such file or directory
/usr/openwin/man/windex: No such file or directory
/opt/hpnpl/man/windex: No such file or directory


1.1.6 The command man followed by the word sort displays detailed information about the command 'sort'.

internet% man sort
Reformatting page. Wait... done

User Commands sort(1)

NAME
sort - sort, merge, or sequence check text files

SYNOPSIS
/usr/bin/sort [ -bcdfimMnru ] [ -k keydef ] [ -o output ]
[ -t char ] [ -T directory ] [ -y [ kmem ] ] [
-z recsz ] [ +pos1 [ -pos2 ] ] [ file ... ]

/usr/xpg4/bin/sort [ -bcdfimMnru ] [ -k keydef ] [
-o output ] [ -t char ] [ -T directory ] [ -y [ kmem ]
] [ -z recsz ] [ +pos1 [ -pos2 ] ] [ file ... ]

DESCRIPTION
The sort command sorts lines of all the named files
together and writes the result on the standard output.

Comparisons are based on one or more sort keys extracted
from each line of input. By default, there is one sort key,
the entire input line. Lines are ordered according to the
--More--(5%)



1.2 Other Ways to Find Help in Unix

1.2.1 Comand help did not work at GGU SunOS 5.7.

internet% help
help: Command not found
internet%



1.2.2 The first command ls -h did not work but gave instructions on how to use the flag. The second command
ls --help worked fine and displayied information about command ls. The results were truncated here.
The book says that a few commands offer lots of output when you use the -h flag.


ls internet% ls -h
ls: invalid option -- h
Try `ls --help' for more information.

internet% ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuSUX nor --sort.

-A, --almost-all do not list implied . and ..
-a, --all do not hide entries starting with .
-B, --ignore-backups do not list implied entries ending with ~



1.2.3 Did not produce the result suggested by the book. It simply ignored the uncommon flags.

internet% man -xyz
usage: man [-] [-adFlrt] [-M path] [-T macro-package ] [ -s section ] name ...
man [-M path] -k keyword ...
man [-M path] -f file ...

internet% man -h
usage: man [-] [-adFlrt] [-M path] [-T macro-package ] [ -s section ] name ...
man [-M path] -k keyword ...
man [-M path] -f file ...
internet%


Different commands displayied diffrent messages when followed by uncommon flags

internet% bc -xyz
bc: illegal option -- x
usage: bc [ -c ] [ -l ] [ file ... ]

internet% cal -xyz
cal: illegal option -- x
usage: cal [ [month] year ]

internet% file -xyz
file: illegal option -- x
file: illegal option -- y
file: illegal option -- z
usage: file [-h] [-m mfile] [-f ffile] file ...
file [-h] [-m mfile] -f ffile
file -c [-m mfile]

internet% grep -xyz
grep: illegal option -- x
grep: illegal option -- z
Usage: grep -hblcnsviw pattern file . . .
internet%

1