Domain Discussion Board

Go Back   Domain Discussion Board > General > Tutorials

 
Reply
 
LinkBack Thread Tools Display Modes
UNIX Tutorial 4
Old
  (#1 (permalink))
blue-sky
Senior Member
blue-sky is an unknown quantity at this point
 
Status: Offline
Posts: 238
Points: 52.5
Bank: 6,643.0
Total Points: 6,695.4
Donate
Join Date: Nov 2006
Rep Power: 0
UNIX Tutorial 4 - 11-26-2006, 05:35 AM

UNIX Tutorial Four



4.1 Wildcards

The characters * and ?

The character * is called a wildcard, and will match against none or more character(s) in a file (or directory) name. For example, in your unixstuff directory, type
% ls list*
This will list all files in the current directory starting with list....
Try typing
% ls *list
This will list all files in the current directory ending with ....list
The character ? will match exactly one character.
So ls ?ouse will match files like house and mouse, but not grouse.
Try typing
% ls ?list





4.2 Filename conventions

We should note here that a directory is merely a special type of file. So the rules and conventions for naming files apply also to directories.
In naming files, characters with special meanings such as / * & % , should be avoided. Also, avoid using spaces within names. The safest way to name a file is to use only alphanumeric characters, that is, letters and numbers, together with _ (underscore) and . (dot).
File names conventionally start with a lower-case letter, and may end with a dot followed by a group of letters indicating the contents of the file. For example, all files consisting of C code may be named with the ending .c, for example, prog1.c . Then in order to list all files containing C code in your home directory, you need only type ls *.c in that directory.
Beware: some applications give the same name to all the output files they generate.

For example, some compilers, unless given the appropriate option, produce compiled files named a.out. Should you forget to use that option, you are advised to rename the compiled file immediately, otherwise the next such file will overwrite it and it will be lost.





4.3 Getting Help

On-line Manuals

There are on-line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behaviour of the command. Type man command to read the manual page for a particular command.
For example, to find out more about the wc (word count) command, type
% man wc
Alternatively
% whatis wc
gives a one-line description of the command, but omits any information about options etc.





Apropos

When you are not sure of the exact name of a command,
% apropos keyword
will give you the commands with keyword in their manual page header. For example, try typing
% apropos copy






learn so much, good for us...
   
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View: 1.0
Points Per Thread: 15.0
Points Per Reply: 5.0


Similar Threads
Thread Thread Starter Forum Replies Last Post
All Programming Tutorials - Online For Ye All! hariharan Wonderful Websites 17 04-29-2007 05:22 AM
Glassy Effect Siggy Tutorial demonfox Tutorials 10 03-08-2007 02:10 AM
UNIX Tutorial 3 blue-sky Tutorials 0 11-26-2006 05:31 AM
UNIX Tutorial 2 blue-sky Tutorials 0 11-26-2006 05:26 AM
UNIX Tutorial 1 blue-sky Tutorials 0 11-26-2006 05:23 AM


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 ©2007, Crawlability, Inc.