Go Back   The macosxhints Forums > OS X Help Requests > UNIX - Newcomers



Reply
 
Thread Tools Rate Thread Display Modes
Old 07-02-2002, 02:43 PM   #1
Morpheus
Triple-A Player
 
Join Date: May 2002
Posts: 104
Commands list?

How do i get a list of commands to do in my terminal.
because i know typing "man commmand" whatever the command was in this case i used the command sudo it told me what it did ....is there anyway to get a list off all these commands and what they do?
Morpheus is offline   Reply With Quote
Old 07-02-2002, 02:56 PM   #2
fireproof
Prospect
 
Join Date: Jan 2002
Posts: 10
One way...

I realize there is always another way to do things in this new UN*X world, so here's my suggestion:
  • open a terminal
  • type
    Code:
    cd /usr/bin
    -return-
  • read the man page for each item.
fireproof is offline   Reply With Quote
Old 07-02-2002, 03:36 PM   #3
griffman
MVP
 
Join Date: Dec 2001
Location: Portland, OR
Posts: 1,471
The best way is to get a UNIX book; the man pages can very from great to really bad.

You can also see all the commands within any given character of the alphabet by typing "a[tab]" or "b[tab]"; replace [tab] with an actual pressing of the tab key, of course :-).

-rob.
griffman is offline   Reply With Quote
Old 07-02-2002, 05:05 PM   #4
greggo
Prospect
 
Join Date: Jul 2002
Posts: 14
To get a quick list of all commands...

Control X Control D
greggo is offline   Reply With Quote
Old 07-02-2002, 06:14 PM   #5
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
there are several commands to help you discover and investigate commands. but
first, the 'full complement of commands'...

in a bash shell, hitting tab on a blank command line offers:
Code:
$ [tab]
Display all nnnn possibilities? (y or n)

!        emacs-20.7   mount_nfs      sum
./       emacsclient  mount_smbfs    sundocs
../      enable       mount_synthfs  sunsolve
...
in tcsh, keying "control-x then tab or control-d" results in the same thing without
the question, here anyway.

what is happening here is the shell is traversing your $PATH variable dir entries
and spitting out any file entries in those dirs that are executable.

it's not a very good way to find commands; it's full of commands you don't want
to see. well, many times, anyhow.

i suggest you explore the commands apropos and whatis...
Code:
% whatis apropos whatis
apropos(1)   - locate commands by keyword lookup
whatis(1)    - describe what a command is

% apropos copy
cp(1)    - copy files and directories
cpio(1)      - copy files to and from archives
dd(1)    - convert and copy a file
...
# a lot of, perhaps, unwanted entries here from 
# man libraries and programming pages

% apropos copy | grep file    # more reasonable filtration
cp(1)    - copy files and directories
cpio(1)      - copy files to and from archives
dd(1)    - convert and copy a file
install(1)   - copy files and set attributes

% apropos copy | egrep "\([1,8]\)"  # just general (1) and admin (8) commands
cp(1)    - copy files and directories
cpio(1)      - copy files to and from archives
dd(1)    - convert and copy a file
install(1)   - copy files and set attributes
...
dbsym(8)     - copy kernel symbol table into db_symtab space
dd(1)    - convert and copy a file
ditto(8)     - copy source directories to destination directory
a little background: these commands are driven off the whatis database. the
whatis database is built (by /etc/weekly) on entries in the man page directories.
[ note that some commands don't have man pages ]

e.g.,
Code:
% egrep ^ls /usr/share/man/whatis.db
ls(1)    - list directory contents
lsbom(8)     - interprets the contents of binary bom (bom(5)) files
lsearch(3), lfind(3) - linear searching routines
lseek(2)     - reposition read/write file offset
lsof(8)      - list open files
above, we've grep'd a whatis.db for entries starting with 'ls' to show what the db
contains.

so, apropos looks up keywords in the whatis database entries; if you apropos 'list'
you'll get a lot of chaff, so use some grep tricks to filter it down some...
Code:
% apropos list | grep dir
dir(1)       - list directory contents
ls(1)    - list directory contents
tree(1)      - list contents of directories in a tree-like format
vdir(1)      - list directory contents
ls(1)    - list directory contents
XFontsOfFontSet(3), XBaseFontNameListOfFontSet(3),...
hope that helps you get a 'grep' on apropos and whatis.
mervTormel is offline   Reply With Quote
Old 07-02-2002, 07:04 PM   #6
Morpheus
Triple-A Player
 
Join Date: May 2002
Posts: 104
thanks ....thanks a lot you guys

This helped me some.
A little confusing but ill have to read closer...
I think im going to get a UNIX book..
I cant wait to learn more....
UNIX Book = My 2nd Bible
Morpheus is offline   Reply With Quote
Old 07-02-2002, 07:06 PM   #7
Morpheus
Triple-A Player
 
Join Date: May 2002
Posts: 104
Quote:
Originally posted by griffman
The best way is to get a UNIX book; the man pages can very from great to really bad.

You can also see all the commands within any given character of the alphabet by typing "a[tab]" or "b[tab]"; replace [tab] with an actual pressing of the tab key, of course :-).

-rob.

I like the A [tab] thing
Morpheus is offline   Reply With Quote
Old 07-02-2002, 07:09 PM   #8
Morpheus
Triple-A Player
 
Join Date: May 2002
Posts: 104
One more small question...

If i get a UNIX book do i need some priar knowledge to UNIX? Or will the book most likely help me to get knowledge. I mean....you think i should get UNIX or OSX book?
Morpheus is offline   Reply With Quote
Old 07-02-2002, 08:53 PM   #9
mervTormel
League Commissioner
 
Join Date: Jan 2002
Posts: 5,536
Quote:
Originally posted by Morpheus
If i get a UNIX book do i need some priar knowledge to UNIX? Or will the book most likely help me to get knowledge. I mean....you think i should get UNIX or OSX book?

depends entirely on the book. some require prior knowldege and do no hand-holding. also, it depends on what you want to explore as they all have their inclinations.

perhaps go to a bookstore and peruse the OSX books for a start, then decide where to focus.

beware: there are a lot of bad books to burn you, so do your homework.
mervTormel is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:33 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.