MAINT

Section: User Commands (1)
Updated: 1 Jan 1992
Index Return to Main Contents
 

NAME

maint - Full-screen file/directory maintenance  

SYNOPSIS

maint [-acdfgopst] [-S [sort-field]]  

DESCRIPTION

maint is a file/directory maintenance utility that combines the functionality of many well-known Unix utilities, adds some new capabilities, and packages them into a full-screen interface that gives you the capability of working with entire directories at one time instead of working with a few files and having to run ls(1) to see the current state of the directory.

Directories are presented as a series of one or more screens, making it possible to associate individual commands with each file/directory. These commands are not actually performed until the directory is "executed" and then all of the commands in the directory will be performed. This allows plenty of time to change or cancel commands with individual files before a possible catastrophe.

Other capabilities, such as browsing and editing files, changing directories, and associating "text descriptors" with files and directories make it possible manage multiple files/directories quickly, easily, and efficiently.  

OPTIONS

-a
Include all files, including those beginning with a period (.).
-c
Ask for confirmation before eXecuting commands in a directory.
-d
Include date field for files.
-f
Include full information for files. Implies -odgsp.
-g
Include group name for files.
-o
Include owner field for files.
-p
Include protection (mode) field for files.
-s
Include size (in bytes) field for files.
-t
Start up in text mode. If maint.tdf does not exist in current directory, this flag is ignored.
-A
Auto-advance the cursor on Delete or Unmark commands.
-F
Marks directories with trailing slash (/), sockets with a trailing equal sign (=), symbolic links with a trailing at sign (@), and executable files with a trailing asterisk (*).
-Ssort-field
Sort files by sort-field; legal value are: size, date, filename. Default is filename.
 

DISPLAY

The screen is divided into three regions. The first region is the directory specification window, along the top of the screen. This window is two lines and contains:
o
The current directory specification. If the current directory is a descendant of your home directory, the home directory portion will not be specified in order to save space. If the current directory is your home directory, the full directory specification will be used.
o
The current page and the total number of pages in the directory.
o
The text descriptor for the directory (if you are in Text mode).

The middle section is the main screen, and will contain information about the individual files and directories. Each file/directory on the screen occupies a "slot". Each file slot can have different characteristics, depending on filename length and commands.

o
If for any reason the full filename of a file won't fit in a file slot, it will be flagged with an asterisk.
o
If the file has any commands associated with it, it will be displayed in bold (or possibly reverse, if your terminal doesn't support bolding). If the file has been marked for deletion, a string signifying such will also appear.

The bottom section is the option line that will display the most commonly-used commands with the character used to invoke them displayed in bold (or reverse). The number of files and the total number of blocks in the directory are also displayed.  

FEATURES

Moving Around.

There are a number of different ways to move around the screen and change the current screen. The following table describes the keystrokes that can be used; be aware that not all keys may be defined on every terminal. If there is a key that looks like it might work, try it. :-)

right (move right one column)
l, Right Arrow, Space, Tab, Greater Than >
left (move left one column)
h, Left Arrow, Less Than <
up (move up one row)
k, Up Arrow, Caret ^
down (move down one row)
j, Down Arrow
plus page (go to next screen in directory)
+, =, Next Screen, control-F
minus page (go to previous screen in directory)
-, _, Previous Screen, control-B
go to page (go to a specific screen in directory)
control-G; prompt will appear for specific page number.

File Commands.

Each file/directory can one or more individual commands associated with it. These commands will not be performed until you actually "execute" them with the Xecute command (see below). To add a command to a file/directory, position the cursor next to it and press the appropriate key. You will be prompted for any necessary information.

To see what commands are associated with a file/directory, use the Information command.

The individual commands and appropriate keystrokes are:

Copy file (C or c)
Copy file to another file. Invalid for directories.
Delete file (D, d, Remove)
Delete file/directory.
Rename file (R or r)
Rename the file to a new filename.
Change group (G or g)
Change group of file/directory. Usually only works for superuser on non-System V machines.
Change owner (o)
Change owner of file/directory. Usually only works for superuser on non-System V machines.
Change protection (P or p)
Change the protection (mode) of a file/directory. The mode can be specified in one of two forms: 1) the way it appears on screen, i.e. rw-r--r--, or 2) octal format, i.e. 755.
Repeat previous file command (.)
Repeat the last file command specified in the current directory.
Text descriptor (T or t)
Add/change a text descriptor for a file/directory. See below for more information about text descriptors.

Other Commands.

Other commands and non-eXecutable file commands available in maint are:

Escape to shell (!)
Starts up a subshell. Exiting the subshell will cause a return to maint.
Search for a file (/)
Search for a filename in the current directory. A prefix search is done so only enough of the filename to identify it is necessary.
Rebuild directory (control-R)
Rebuild the current directory, discarding all file commands for the directory. This is sometimes necessary in very volatile directories where the information in maint might not be in sync with the current state of the directory.
Edit file (E or e)
Edit the current file. The EDITOR environment variable will be used for the editor if it is defined. The default is vi.
Finish directory (F or f)
Exit the current directory and return to previous directory if one exists. If the current directory is the top-level directory, this key is invalid. If any commands exist in the current directory, maint will ask for confirmation before leaving the directory.
Quit (Q or q)
Exit maint immediately. If file commands exist in any directory, maint will ask for confirmation before quitting.
Information (I or i)
Give full information on file/directory including size, mode, access date, modification date, creation date, owner, group, text descriptor (if any), and any file commands.
Unmark file (U or u)
Cancel all marks for the file/directory.
Select file/directory (S, s, Select)
If Selecting a file, invoke the a pager on it to allow the file to be browsed. The PAGER environment variable is checked first. If PAGER is not set, the default pager for the system is used. Exiting the pager will cause a return to maint.

If Selecting a directory, change to that directory, saving the state of the current directory.

Repaint
Refresh the current screen.
Options
Change the current configuration for maint. The Configuration Menu will be displayed, showing the current configuration values. Use j and k to select a parameter (or use the run-time argument letter (for example, g for Group)) and press the space bar to turn the parameter on/off. Enter control-D to return to the main display. The display will be updated to reflect the new configuration.

Text Descriptors.

maint has the ability to maintain extended textual descriptors for files within a given directory. What text descriptors do is allow you to associate up to a 40-character description with any file in a directory, along with having up to a 70-character description of the directory itself. This is particularly useful when maintaining directories with a large number of files. To use the extended file descriptor facility, do the following:

1.
Run maint.
2.
Type a T (Text) command.
3.
maint will ask
Text descriptor file maint.tdf does not exist.  Create it [y]?
4.
Respond with something other than N or n for the file to be created.
5.
maint will then ask
Text descriptor for directory:
6.
Enter a text descriptor (up to 70 characters) for the DIRECTORY. This will serve as a descriptor of the group of files in the DIRECTORY and will appear at the top of the screen.
7.
maint will then ask
Commands will be wiped out.  eXecute them? [y]
8.
Enter something other than N or n to have all of the current file commands eXecuted when the text descriptor file maint.tdf.
9.
maint will rebuild the directory information and rebuild the screen, including the text descriptors for the directory and text descriptor file itself, provided they will fit on the screen. Even if they can't fit on the screen, they are still available for each file via the I (Info) command.

The text descriptor file has now been created. To add or modify a text descriptor for a file, move to a the file and type a T (Text) command. You will be prompted for the text descriptor for the file. It will be updated when you Xecute the commands for the directory.

On subsequent uses of maint, text mode may be entered by one of two methods:

1.
Use the -t on the command line. This will cause maint to use text mode if the file maint.tdf exists.
2.
Use the T (Text) command. Again, if maint.tdf exists, maint will enter text mode.

Either way, once in text mode, the T (Text) command may be used to add or change the text descriptor for a file.

 

ENVIRONMENT

EDITOR   used for Edit command
PAGER    pager to use for Select command on a file
SHELL    shell to invoke for shell escapes
 

RESTRICTIONS

Could experience unpredictable results on terminals with that are less than 24 X 80.

There is no limitation on the number of files in a directory that maint can handle other than the amount of memory that it can request from the operating system.

As of this writing, the function and arrow keys won't work on Ultrix 3.0. :-(  

SEE ALSO

chmod(1), chgrp(1), chown(1), csh(1), more(1), ls(1), mv(1), rm(1), sh(1).  

AUTHOR

Leonard J. Peirce @ Western Michigan University Academic Computing Services (peirce@gw.wmich.edu).


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
DISPLAY
FEATURES
ENVIRONMENT
RESTRICTIONS
SEE ALSO
AUTHOR

This document was created by man2html, using the manual pages.
Time: 21:51:28 GMT, February 02, 2023