NAME
utree - Screen oriented filesystem browser and utility
SYNOPSIS
utree [options] [rootdirectory]
DESCRIPTION
The screen oriented filesystem browser and utility utree
descends the directory hierarchy rooted in your home
directory, defined in a tree list file if given, or rooted
in rootdirectory if given, and displays the directory tree
on the so called tree screen. On the tree screen utree
lets you walk thru the tree, execute some default and user
defined commands on it and change to any directory in the
tree.
If you have changed to a directory utree displays all
files in this directory on the so called file screen. On
the file screen utree lets you walk thru the file list and
execute some default and user defined commands on files.
Some utree versions support the mouse if running in a
xterm window and use colors instead of video attributes if
running on a terminal type with ANSI compatible color
capabilities.
OPTIONS
The following command line options are interpreted by
utree:
-8 Set character size to 8 bit (if needed and
not yet done by getty).
-C Use colors instead of video attributes.
This works on ANSI compatible color termi-
nals only!
-L Follow symbolic links to directories
-M Use the mouse if utree is running in a
xterm window
-S Ignore default minimal screen size of 80
columns and 24 lines
-V Display utree version, copyright notice
and compile options
-X Use special graphical characters from
utree fonts if running utree in a xterm
window
-a Read in all directories, including those
that begin with a dot (.), which are nor-
mally skipped
Oct 19 1992 UTREE Version 3.04a-um 1
UTREE(1L) UTREE(1L)
-b Suppress ringing of the bell (useful for
visual bells)
-c Don't display and update a clock every
second
-d var=[val] Set the variable var to value val or unset
the variable var
-d typ:[cmd] Define the command cmd for the filetype
typ or undefine any command for the file-
type typ
-f lst Build directory tree from list file lst
-g Don't use graphical characters
-h Display usage and some help about options
-i ind Set the tree level indention to ind
columns (3..9)
-j lin Use lin lines for displaying filenames of
the current directory on the tree screen
(default: 3)
-n Avoid scanning the tree for changes i.e.
after shell escape
-l lev Build the tree up to level lev for quicker
startup
-o Omit saving changes in variables and file-
type command definitions, command history
and key bindings
-p Don't use the builtin pager for listing
and viewing files
-q Build the tree up to level 2 (like -l 2)
-r Build the tree scanning and reading the
file system instead of reading a tree list
file
-s Don't use hardware scrolling
-u Read and update all file lists after
building the tree from a tree list file
-v mod Set using video attributes to mode mod.
mod may be 2 for all possible, 1 for bold
and underline and 0 for none video
attributes.
Oct 19 1992 UTREE Version 3.04a-um 2
UTREE(1L) UTREE(1L)
-w Suppress warnings about unreadable direc-
tories
-x cmd Use and execute the string cmd as initial
input at startup. The string cmd is a
simple sequence of utree commands
The boolean options 8CLMXbcginosw and the numerical
options ijv may also be pre-set in the environment vari-
able UTREE. E.g. if you want to suppress ringing of the
bell and displaying and updating the clock and if you pre-
fer a tree indention of 4 columns set the environment
variable UTREE to 'bci4' for this reason.
Most of the options correspond to utree variables and
therefore they may also be set or unset with the variable
command (=). See the sections global commands and vari-
ables below.
UTREE STARTUP
If utree is called without the optional command line
parameter rootdirectory or this directory is rooted in
your home directory utree tries to build up the directory
tree reading a file .utreelist in your home directory,
which contains a list of your directory tree created by a
previous utree session or by the additional shell script
utree.mklist called before. If the command line option -f
lst is given utree builds up the tree from this list file
lst which may be created with the denoted shell script
utree.mklist or a command like find. Entries in such list
files have to start with the directory separator / (slash)
in the first column of the line. All other entries are
ignored and skipped.
If building the tree from a list file the file lists of
directories are created and read in on demand only, which
means when a directory becomes the current directory by
moving the cursor to this directory. This speeds up the
start of utree because there is no need for scanning and
reading the filesystem for subdirectories what may take
some time for larger filesystems.
In all others cases, if no list file is given with the
command line option -f lst, rootdirectory is rooted in
your home directory and the file .utreelist is not found,
or the command line option -r is given utree builds up the
tree by scanning and reading the filesystem recursively.
You can speed up the start with the commandline option -l
lev which causes utree to build the initial directory tree
only up to level lev similar to the option -l of the well
known find command. At runtime some commands let you
expand the directory tree later and inspect directories
and subtrees not visible at startup (see below).
Oct 19 1992 UTREE Version 3.04a-um 3
UTREE(1L) UTREE(1L)
SCREEN LAYOUT
The screen is divided into three regions. The top screen
line, the so called echo line is for displaying messages
and entering input. The second screen line, the so called
help line is for displaying help messages and the utree
default or user defined menu lines.
The rest of the screen forms a window on the directory
tree on the tree screen or on the file list of the current
directory on the file screen. Or he is used for display-
ing variable or filetype commands settings, for displaying
help pages and displaying command outputs.
UTREE SCREENS AND MENUS
Utree knows the following screens and menus:
tree screen This is the initial screen displayed
when utree is started and has built up
the directory tree. The tree screen
forms a window on the directory tree.
The current directory on which most
commands are working is highlighted
and the last screen lines are used to
display the first files of the file
list of the current directory. You
may move the window over the directory
tree, enlarge or shrink the directory
tree window or walk thru the directory
tree and execute default and user
defined commands on directories and
subtrees. On the help line the most
important commands available for
directories or subtrees on the tree
screen are shown in the default tree
menu. The tree menu shows the names
of the the tree screen commands, the
keystrokes to invoke a command are
marked with uppercase letters. You
may switch the menu to a user defined
menu line displaying user defined com-
mands for the tree screen. For fur-
ther information about all tree screen
commands see the sections global com-
mands, tree screen commands and vari-
ables of this manual page.
file screen The file screen forms a window on all
files of the current directory. The
current file on which most commands
are working is highlighted. Yoy may
move the window over the file list or
walk thru the file list and execute
default and user defined commands on
Oct 19 1992 UTREE Version 3.04a-um 4
UTREE(1L) UTREE(1L)
files. On the help line the most
important commands for files available
on the file screen are shown in the
default file menu. The file menu dis-
plays the names of the the file screen
commands, the keystrokes to invoke a
command are marked with uppercase let-
ters. You may switch the menu to a
user define menu line displaying user
defined commands for the file screen.
For further information about all file
screen commands see the sections
global commands, file screen commands
and variables of this manual page.
help screen If you have switched to the help
screen with the help command (h) on
the help line the help menu is dis-
played and you may select help about
interesting topics. The help menu
displays the names of all available
help topics, the keystrokes to select
help about a topic are marked with
uppercase letters. For more informa-
tion see the section help pages below.
variables screen If you have switched to the variables
screen with the variables command (=)
all variables and their settings are
displayed and you may set or unset any
of the variables. On the help line is
shown how to set or unset a variable
in a short form. All changes in vari-
ables definitions are saved to the
file .utree in your home directory if
the variable AUTOSAVE is set. For
more information see the section vari-
ables below.
commands screen If you have switched to the filetype
commands screen with the filetype com-
mands command (:) all filetype com-
mands and their settings are displayed
and you may set or unset any of the
filetype commands. On the help line
is shown how to set or unset a file-
type command in a short form. All
changes in filetype command defini-
tions are saved to the file .utree in
your home directory if the variable
AUTOSAVE is set. For more information
Oct 19 1992 UTREE Version 3.04a-um 5
UTREE(1L) UTREE(1L)
see the section filetype commands
below.
shell screen If you have switched to the shell
screen with the shell command (!) for
executing commands not supported
directly by utree all previously
entered commands saved in a so called
history list are displayed on the
shell screen. The last executed com-
mand is marked with ->. You may get
any command from the history list into
the line editor for editing and execu-
tion or enter and execute a new com-
mand. To get a command from the his-
tory list into the line editor you can
use the keys C-p for the previous com-
mand or C-n for the next command in
the history list. To get a command by
number enter !number, to get a command
by a search pattern enter !pattern.
All commands up to a maximal number
defined in the variable HISTSIZE are
saved in the history list. Before
leaving utree all saved commands in
the history list are saved to a his-
tory file .utreehist in your home
directory if the variable AUTOSAVE is
set. At startup this file is searched
for and read in if found. For more
information see also the section vari-
ables below.
bindings screen If you have switched to the bindings
screen with the bindings command (|)
all currently defined key bindings and
their meaning are displayed and you
may bind any key to an appropriate
utree command or to insert a string
into the input buffer. At startup
utree looks for and reads in a file
.utree-TERM in your home directory or
a file utree-TERM in a global startup
directory. This files contain key
bindings for the terminal type defined
in the environment variable TERM. All
changes in key bindings you have done
on the bindings screen at runtime are
saved to .utree-TERM if the variable
AUTOSAVE is set. For more information
see also the section key bindings
below.
Oct 19 1992 UTREE Version 3.04a-um 6
UTREE(1L) UTREE(1L)
status screen The status command (s) displays all
information available about a file or
directory on the status screen. Here
you may change the ownership, group
membership or access rights of a file
or directory. On BSD and POSIX sys-
tems not all of the denoted changes
may be allowed for normal users.
KEY NAMING CONVENTIONS AND DEFAULT KEY BINDINGS
All utree commands are simple single letter commands or
control sequences. The default or user defined commands
therefore are invoked with a single keystroke or a combi-
nation of the <CONTROL> key with another key. The naming
conventions in the following manual sections for utree
commands invoked by a keystroke are:
key means hit this <key> only
C-key means hold down the <CONTROL>-key and
hit <key>
To permit rebinding of pre-defined keys or binding func-
tions keys to utree commands all control sequences have
special names. All key or functions names and their
default bindings are list in the table below
SELECT CR, NL
FORWARD C-f
BACKWARD C-b
NEXT C-n
PREVIOUS C-p
NEXTPAGE C-v
PREVPAGE C-w
BEGIN C-a
END C-e
UP C-u
DOWN C-d
INSERT C-o
DELETE BS
Oct 19 1992 UTREE Version 3.04a-um 7
UTREE(1L) UTREE(1L)
KILL C-k
SETMARK C-@
GOTOMARK C-g
GOTOTAG C-t,TAB
HELP C-r
REFRESH C-l
CANCEL C-x
BREAK C-c,C-y
EXIT C-z
In the following sections of this manual page the default
key bindings are used instead of the names or functions.
Some function keys are supported by utree, i.e. the four
arrow or cursor keys, and are bound to appropriate func-
tions. See the sections key bindings and function keys
below for more details.
HELP PAGES
If the utree help pages contained in the file utree.help
are accessible in a directory defined at compile time or
defined in the environment variable UTLIB you can get help
on all screens or from within the line editor with the
help command (h or ?) or the help key (C-r). After dis-
playing help about your current context, i.e. help about
tree commands if you are on the tree screen, you can
switch to the help menu and select help about all topics
with a single keystroke. All help screen commmands and
the menu items of the help menu displayed on the help line
are:
h (Help) About the help pages and the help
menu
a (About) Information about utree and key
naming conventions
u (Usage) Description of utree usage and
commandline options
g (Global) Global commands common for the
tree and the file screen
t (Tree) Commands for the tree screen
Oct 19 1992 UTREE Version 3.04a-um 8
UTREE(1L) UTREE(1L)
f (File) Commands for the file screen
e (Edit) Commands of the builtin line editor
v (Vars) Utree variables and variable defi-
nition
c (Cmds) Filetype commands and filetype com-
mand definition
l (Line) Line format for user defined tree,
file and filetype commands.
k (Keys) Function keys used by utree
p (Patterns) File pattern matching, file-
name, modification time and file size pat-
terns
q (Quit) Leave help screen
The help pages contain in short form most information
given in the sections of this manual page.
GLOBAL COMMANDS
The following commands are common for the tree and file
screen They can be given in lowercase or uppercase let-
ters:
C-z Exit utree from all screens
C-c,C-y Cancel or break current command or
input
C-l Redisplay the current screen or the
input line
TAB,C-t Move to the next tagged file or the
next directory containing tagged files
h,?,C-r Display help pages and switch to the
help screen and the help menu
@,C-@ Mark the current directory or file
#,C-g Goto to a previously marked directory
or file
a Display utree version and copyright
notice
d Display current date and time
j Move to the next directory or file
(for vi fans)
k Move to the previous directory or file
(for vi fans)
n Change sort criteria from lexical
order to modification time order or
vice versa and resort files in the
file list
t Tag files matching a file pattern for
further processing
u Untag files
w Display full pathname of the current
directory
z Zoom files from filelist matching a
file pattern
= Switch to the variables screen, dis-
play and set or unset variables
: Switch to the commands screen, display
and set or unset filetype commands
| Switch to the bindings screen, display
all key bindings and bind or rebind
keys
! Switch to the shell screen, display
all commands from the shell command
history list, enter and execute com-
mands not supported directly from
utree. Before a given command is exe-
cuted the command line is searched for
some sprintf like format characters
lead in by a percent sign (%) which
are expanded. See the section line
formats for more information
$ Escape to an interactive shell
TREE SCREEN COMMANDS
All commands on the tree screen can be given in lowercase
or uppercase letters with the meaning denoted below. Com-
mands given in lowercase letters affect the current direc-
tory only. Commands given in uppercase letters indicated
by an uppercase letter in the table below affect the sub-
tree rooted in the current directory or all tagged files
in the subtree rooted in the current directory. The tree
screen commmands and the menu items of the default tree
menu displayed on the help line are:
>,CR,NL,SP,> Change to the file screen of the cur-
rent directory
< Change to the file screen of the par-
ent directory
C-n Move to the next directory
C-p Move to the previous directory
C-f Move to the next directory on same
level as the current directory
C-b Move to the previous directory on same
level as the current directory
C-v Move one page forward
C-w Move one page backward
C-a Move to the beginning of the directory
tree
C-e Move to the end of the directory tree
TAB,C-t Move to next the directory containing
tagged files
C-u Scroll up one line the directory tree
C-d Scroll down one line the directory
tree
@,C-@ Mark the current directory
#,C-g Move to a previously marked directory
h,? (Help) Help about tree screen commands
b,B (Backup) Backup the current directory
or tree or backup all tagged files in
the subtree
c,C (Chdir) Move to a directory or copy
all tagged files in the subtree.
Before you move to a directory you are
requested for the name of this direc-
tory before. Instead entering a name
you can select a directory from the
tree with C-n and C-p. Instead of
entering a name of a directory where
to copy the tagged files you can
select a directory from the tree with
C-n and C-p or directly from tree
screen using CR.
f,F (Find) Find files in the current
directory or subtree matching a file
pattern you have to enter before. If
a file matching the given pattern is
found you may tag this file, change to
the directory containing the found
file or continue find
g,G (Grep) Search for pattern in files in
the current directory or subtree. You
are requested for a file and a search
pattern. If a file matching the
search pattern is found you may tag
this file, change to the directory
containing the found file or continue
search
i (Info) Display some short information
about the current directory. Dis-
played are access rights, modification
time and the disk usage of the current
directory or subtree
l,L (List) List files in the current
directory or subtree matching a file
pattern you are requested before or
list all tagged files in the subtree
m,M (Mkdir) Create a new directory rooted
in the current directory or move all
tagged files to a destination direc-
tory. Instead of entering the direc-
tory name you can select this name
from the directory tree with C-n and
C-p or directly from tree screen using
CR.
n,N Change the sort criteria from lexical
order to modification time order or
vice versa and resort the file list of
the current directory or subtree
o (Out) Write a list of directories,
files, tagged files, files matching a
file pattern or a formatted tree list
to a list file. A formatted tree list
file can later be displayed on the
screen or send to a printer using the
additional filter command utree.prlist
q (Quit) Leave the tree screen and exit
utree
r,R (Rmdir) Remove the current directory
or all tagged files in the subtree. A
directory to be removed may not con-
tain any subdirectories.
s (Stat) Switch to the status screen,
display all status information of the
current directory and change owner,
group and access rights of the current
directory
t,T (Tag) Tag files in the current direc-
tory or subtree matching a file pat-
tern you are requested before
u,U (Untag) Untag files in the current
directory or subtree
z,Z Zoom files matching a file pattern in
the current directory or subtree.
Zooming means that only those files
matching the file pattern are dis-
played and visible for further pro-
cessing.
+ Enlarge the tree window, shrink the
file window one line
- Shrink the tree window, enlarge the
file window one line
/ Scan the current directory or tree and
rebuild directories if they need
rebuilding (i.e. if they are not yet
read in or have changed)
Scan the current directory for subdi-
rectories and build up and insert the subtree
into the directory tree. You are requested for
the maximal tree level to build up
0 Switch the tree menuline from the
default to the user defined tree com-
mands or vice versa
1..9 Execute the user defined tree command
1 .. 9
For further information about file patterns for the com-
mands find, grep, list, tag and untag see the section file
patterns below. For user defined tree commands see the
section variables.
FILE SCREEN COMMANDS
All commands on the file screen can be given in lowercase
or uppercase letters with the meaning denoted below. Com-
mands given in lowercase letters affect the current file
only. Commands given in uppercase letters indicated by an
uppercase letter in the table below affect all tagged
(selected) files if files are tagged or the current file
if no files are tagged. The file screen commmands and the
menu items of the default file menu displayed on the help
line are:
q,CR,NL,SP (Quit) Leave the file screen and
change back to the tree screen
C-f Move to the next file
C-b Move to the previous file
C-n Move to the file on the next line
C-p Move to the file on the previous line
C-v Move one page forward
C-w Move one page backward
C-a Move to the beginning of the file list
C-e Move to the end of the file list
TAB,C-t Move to the next tagged file
C-u Scroll up one line the file screen
C-d Scroll down one line the file screen
@,C-@ Mark the current file
#,C-g Move to a previously marked file
h,? (Help) Help about file screen commands
and switch to the help screen
c,C (Copy) Copy the current file or tagged
files. You are requested for a desti-
nation file or directory where to copy
the file or tagged files. Instead of
entering a directory name you can
select a destination directory using
C-n and C-p or select directly on the
tree screen with CR
e,E (Edit) Edit the current file or tagged
files
f (Find) Find files matching a file pat-
tern you are requested before
g,G (Grep) Search for a pattern in the
current file or tagged files. Before
search you are requested for a file
pattern and the search pattern to
search for
i,I Display some short information about
the current file or tagged files.
Displayed are the access rights, the
size and the modification time of the
current file or tagged files
l,L (List) List files matching a file pat-
tern you are requested before or all
tagged files
m,M (Move) Move or rename the current file
or tagged files. You are requested
for the new file name or a destination
directory where to move the current
file or tagged files Instead of enter-
ing the name of a destination direc-
tory you can select a directory using
C-n and C-p or directly on the tree
screen with CR
n Change the sort criteria from lexical
order to modification time order or
vice versa and resort the file list
p,P (Print) Print out the current file or
tagged files
r,R (Remove) Remove the current file or
tagged files. Before removing you are
asked if you really want to remove the
current file or tagged files
s,S (Stat) Switch to the status screen
display all status information of the
current or tagged files and change
owner, group and access rights of the
current file or tagged files
t,T (Tag) Tag the current file or files
matching a file pattern you are
requested before for further process-
ing
u,U (Untag) Untag the current file or
files matching a file pattern you are
requested before
v,V (View) View the current file or tagged
files
x,X Execute the current file or tagged
files. If a filetype command is
defined for this file you can execute
this filetype command, otherwise you
are requested for a command or for
parameters to execute
z Zoom files matching a file pattern
> If the current file is a directory
change to the file screen of this
directory
< Change back to the file screen of the
parent directory
/ Rebuild the file list (i.e. after
shell escape)
0 Switch the menuline from the default
to the user defined file commands or
vice versa
1..9 Execute the user defined file commands
1 .. 9
For further information about file patterns for the com-
mands find, grep, list, tag and untag see the section file
patterns below. For user defined file commands see the
section variables. For filetype command execution invoked
with the command x see the section filetype commands
below.
LINE EDITOR COMMANDS
Many utree commands need some user input for further pro-
cessing which is done with a builtin simple line editor.
Many commands pre-set the input buffer with a default
input line if this default is known. For some commands
you can use the keys C-n and C-p to scroll in already
existing input lists and select an input line for editing
or processing without entering the line completely. The
line editor knows about the following functions:
CR,NL Accept and send the input line
C-c,C-y Cancel input and leave the line editor
C-o Switch from overwrite-mode to insert-
mode or vice versa
C-l Redisplay the input line
C-f Move the cursor one character forward
C-b Move the cursor one character backward
C-a Move the cursor to the beginning of
the input line
C-e Move the cursor to the end of the
input line
C-v Scroll horizontally forward the input
line
C-w Scroll horizontally backward the input
line
C-d Delete one character under the cursor
C-h,DEL Delete one character left from the
cursor
C-x Delete the input line completely
C-k Delete the input line from the cursor
position to the end
C-t Transpose two characters under and
left from the cursor
C-r Display help pages and switch to the
help screen
C-@ Set a mark at the current cursor posi-
tion
C-g Move the cursor to the previously
marked position
C-n Get the next entry into the line edi-
tor
C-p Get the previous entry into the line
editor
input line, inserted in insert-mode or overwrite the char-
acter under the cursor in overwrite-mode. The current
mode is displayed at the end of the help line. Most line
editor commands are also available with function keys, see
the section function keys below.
VARIABLES
Utree knows about and uses the following variables which
may be set or unset at startup in the startupfile
$HOME/.utree, with some commandline options (see options
above), or the variables command (=) on the variables
screen:
BELL or BL: Allow ringing of the bell if
set
CLOCK or CL: Show and update clock every
second if set
GRAPHCHARS or GC: Use the graphical character set
if set. Not all terminal database
termcap or terminfo definitions of the
graphical character set are correct
USEPAGER or UP: It set use the builtin pager
for listing and viewing files. If not
set a pager as defined in the variable
PAGER will be used.
TERMSCROLL or TS: Use hardware terminal scrolling
if set. On some terminals (i.e. on
the X terminal emulator xterm) redraw-
ing the screen may be faster than
scrolling
SCANTREE or ST: Allow scanning the tree for
changes if set. Many commands scan
the directory tree after execution
what may take some time. Prohibiting
tree scanning therefore may speed up
utree a little bit
WARNDIRS or WD: Allow warnings and requests
about unreadable directories if set
LEXSORT or LS: Sort filenames in lexical order
if set, in order of modification times
if not set.
AUTOSAVE or AS: Save changes in variables or
filetype commands definitions, key
bindings and history list to appropri-
ate files in the home directory
TREEINDENT or TI: Set the tree level indention
column (3 .. 9) if possible. Normally
the tree level indention column is
calculated dependent on the number of
screen columns and the maximal
filesystem depth automatically
VIDEOMODE or VM: Set using of video attributes.
2 means use all possible attributes
and their combinations. 1 means use
the attributes reverse and underline
only. 0 means don't use any video
attribute.
FILELINES or FL: Number of lines of the file
window on the tree screen (1 .. 9,
default 3)
HISTSIZE or HS: Maximal number of shell com-
mands which are hold in the shell com-
mands history list (6 .. 99, default:
22)
FNAMELEN or FN: Length of filenames on screens
(10 .. 75, default: 15)
EDITOR or ED: Program for editing files.
When redefining the editor variable
don't forget to check and set or unset
the editopts variable for editor
options
EDITOPTS or EO: File editor options
PAGER or PG: Program for viewing files.
When redefining the pager variable
don't forget to check and set or unset
the pageopts variable for pager
options
PAGEOPTS or PO: File pager options
XDUMPER or XD: Program for hexdumping files.
When redefining the hexdumper variable
don't forget to check and set or unset
the xdumpopts variable for hexdumper
options
XDUMPOPTS or XO: File hexdumper options
LPRINTER or LP: Program for printing files or
sending files to the printer spooling
system. When redefining the
lineprinter variable don't forget to
check and set or unset the lprintopts
variable for lineprinter options
LPRINTOPTS or LO: Printer options
BACKUP or BK: Program or shell script for
backing up a directory or tree
BACKUPOPTS or BO: Backup options
SHELL or SH: Interactive shell for shell
escape
TREECMD1..9 or T1..9: User defined tree screen
commands 1 .. 9
FILECMD1..9 or F1..9: User defined file screen
commands 1 .. 9
Variables are set with a line 'variable=value' or 'short-
hand=value' (i.e. 'treecmd1=ps -ef' or 't1=ps -ef') and
unset with a line 'variable=' or 'shorthand=' (i.e.
't1='). When defining user tree or file commands some
sprintf like format characters lead in by a percent sign
(%) have a special meaning and are expanded before the
command is executed. For further information about the
command line format see the section line formats below.
The last sharp sign (#) in a variable definition is used
as leadin for a menu item of the defined user file or tree
command. Example: the variable definition 'fc1=wc -l %F
#Count' for the user defined file command 1 is expanded to
'wc -l filename' and in the user command file menu 'Count'
is displayed behind menu item 1.
FILETYPE COMMANDS
On file screen you can execute a file or a command on it
with the utree execute command (x). You are requested for
parameters if the current file is executable, for a com-
mand to execute on the current file if it is not exe-
cutable. For a type of file you can define so called
filetype commands which are called if the current file
matches a given file pattern.
Filetype commands can be set and unset at startup in the
startupfile $HOME/.utree, with the commandline option -d
or the filetype command (:) similar to setting and unset-
ting variables. Filetype commands are set with a line
like 'filetype:command' (i.e. '*.c:cc -c -O'). The com-
mand (i.e. 'cc -c -O') is then executed if the current
file matches the given file pattern (i.e. '*.c' for a C
source file ending with '.c'). Filetype commands are
unset with a line 'filetype:' (i.e. '*.c:').
When defining filetype commands some sprintf like format
characters lead in by a percent sign (%) have a special
meaning and are expanded before the command is executed.
For further information about file patterns and the format
line characters and her meaning see the sections file pat-
terns and line formats below.
LINE FORMATS
When defining a user tree or file command or a filetype
command some sprintf like format line characters are known
and expanded before the command is executed. These format
line characters and their meaning are:
%B or %b is expanded to the basename (filename
without extension) of the current file
or directory
%D or %d is expanded to the full pathname of
the current directory
%F or %f is expanded to the filename of the
current file or directory
%H or %h is expanded to the pathname of your
home directory
%P or %p is expanded to the full pathname of
the current file or directory
%R or %r is expanded to the pathname of the
root directory from where utree was
started
%S or %s is expanded to additional parameter(s)
for a command which are requested
before the command is executed
%T or %t is expanded to the filenames of all
tagged files from the current direc-
tory
The command line 'command %s %f >%b.out' i.e. is expanded
before execution to 'command parameters filename >base-
name.out' with filename of the current file or directory
(%f), basename.out of the current file or directory
(%b.out) and additional parameters (%s) which are
requested before command execution.
For further information about tree, file and filetype com-
mands see the sections variables and filetype commands.
FILE PATTERNS
Some commands (list, find, grep, tag or untag) require
file patterns for matching files using some special (or
meta) characters.
Shell like filename pattern matching interprets the fol-
lowing meta characters:
* matches all characters in a filename
? matches one character in a filename
[class] matches one character from a character
class. A character class includes all
characters enclosed between the open-
ing and closing brackets ([ and ]).
If in a class definition a minus sign
(-) is found between two other charac-
ters this means the range from the
character before and the character
behind the minus sign. If the first
character of a class definition is a
exclamation mark (!) this means match-
ing of all characters excluded those
defined in the class, i.e.
[abc] matches the characters 'a', 'b' and
'c'
[a-z_] matches the characters from 'a' to
'z' and '_'
[!a-z_] matches all characters except 'a' to
'z' and '_'
File size pattern matching interprets the following meta
characters:
=size matches all files of size size
!size matches all files not of size size
>size matches all files larger than size
<size matches all files smaller than size
Size may be specified in bytes (b, default), kilo bytes
(k) or mega bytes (m), i.e. '>2k' matches all files larger
than 2 kilo bytes or 2048 bytes.
The additional file time pattern matching interprets the
following meta characters:
)time matches all files modified within time
(time matches all files not modified within
time
Time may be specified in minutes (m), hours (h, default),
days (d) or weeks (w), i.e. ')2d' matches all files modi-
fied within last 2 days.
To combine shell like filename patterns and/or additional
file size and modification time patterns use
& for ANDing of patterns
| for ORing of patterns
If a character is preceeded by a backslash or enclosed in
quotes his interpretation is suppressed and he is used as
he is.
KEY BINDINGS
All defaults key bindings are listed in the section key
naming conventions and default key bindings above. All
supported function keys if defined in the termcap or ter-
minfo terminal database and their default bindings are
listed in the next section. Rebindings of default keys or
additional bindings of other keys may be done in terminal
dependent startupfiles utree-TERM in a global directory
containing utree startupfiles or in files .utree-TERM in
your home directory where TERM denotes the terminal type
as defined in the environment variable TERM. These
startup files are built from lines like
'key_sequence=utree_key' or 'key_sequence="string"'.
Key_sequence describes the function key string, utree_key
the utree key or function name, a string enclosed in
braces a string to insert into the input buffer. A com-
ment lead in by a sharp sign (#) should contain the name
of the bound key. For defining key sequences of function
keys control keys are defined with a leading caret (^,
i.e. ^x, ^? means DEL) and some other special characters
may be defined lead in by a backslash (). These escaped
characters and their meaning are: b backspace (^h), f
formfeed (^l), n newline (^j), r return (^m), t tab (^i),
e or E escape (^[ or ESC) and s space. If a backslash is
followed by up to three digits this defines an octal given
character. I.e. the definition '\^O 03=END' binds the
keystring <ESCAPE> <CONTROL-O> <ASCII-3> to the utree key
or function END.
The simplest way to define keys is to switch to the bind-
ings screen and there to do all bindings. You have only
to hit the key to bind and terminate the key sequence with
CR or NL. Therefore CR or NL or key sequences containing
CR or NL cannot be bound on the bindings screen. Then you
have to enter the utree name where the key is to bind to.
You can use C-n and C-p to select the wanted name. At
last you should give a short comment to the bound key(i.e.
the key name) for documentation. If you want to bind a
key for insertion of a string (and so to bind function
keys to simple letter commands) you have to enter the
string enclosed in double quotes. I.e. the binding
'\h="h"' binds the key <ESCAPE> <h> to the string <h> and
the so called help. Any bindings you have done on the
bindings screen are saved to a file .utree-TERM into your
home directory if the variable AUTOSAVE is set.
BUILTIN PAGER
For displaying the contents of the help, variables, com-
mands, bindings, status and shell screens and for viewing
and listing files on the tree and file screens utree uses
his builtin pager. The pager knows about the following
commands or functions:
C-c,C-y,q Cancel pager and return
C-l Redraw the pager screen
C-f,C-n,j Move on line forward
C-b,C-p,k Move on line backward
C-a Move to beginning
C-e Move to end
C-v Scroll one page forward
C-w Scroll one page backward
C-u Scroll one line up
C-d Scroll on line down
C-z Leave pager and exit utree
On the variables, commands and shell screens you can
select a variable, a filetype command or a shell command
for setting, resetting or execution by moving the cursor
to the line containing the wanted variable or command and
get this item into the line editor with CR or NL. Enter-
ing SP changes immediately to the line editor.
For viewing and listing files the builtin pager is used
only if the variable USEPAGER is set. This is the
default. Otherwise a pager is called as defined in the
variable PAGER with options defined in the variable
PAGEOPTS. Additional pager commands for viewing and list-
ing files are:
g Move to a line by line number
f Search forward for a pattern
b Search backward for a pattern
Patterns for searching forward or backward can be a pat-
tern built like file name patterns. For more information
about variables and patterns see the sections variables
and file patterns.
FUNCTION KEYS
The following function keys are supported by utree and
pre-bound at startup to appropriate functions if they are
defined in your system's termcap or terminfo database:
CursorRight Move forward (FORWARD, C-f)
CursorLeft Move backward (BACKWARD, C-b)
CursorUp Move up (PREVIOUS, C-p)
CursorDown Move down (NEXT, C-n)
Home/Begin Move to beginning (BEGIN, C-a)
End Move to end (END, C-e)
NextPage/PageDown Move one page down (NEXTPAGE, C-v)
PrevPage/PageUp Move one page up (PREVPAGE, C-w)
ScrollUp Scroll one line up (UP, C-u)
ScrollDown Scroll one line down or delecte char-
acter (DOWN, C-d)
Insert Change to directory (>) or switch
insert/overwrite mode (INSERT, C-o)
Delete Change to parent directory (<) or
delete character under cursor like
(DELETE, C-h)
Clear Refresh screen or input line (REFRESH,
C-l)
Help Call the help menu (HELP, C-r)
Select Select and/or accept (SELECT, CR,NL)
Do/Command Select and/or accept (SELECT, CR,NL)
Mark Set a mark (SETMARK, C-@)
Enter Select and/or accept (SELECT, CR,NL)
This function keys may be rebound or other function keys
may be bound on the bindings screen. For more information
about key bindings see the section key bindings above.
XTERM MOUSE USAGE
Some utree versions (compiled with the flag USEXTERMMOUSE)
can use the mouse if running in a xterm window if utree is
called with the command line option -M. If you use the
special utree fonts for xterm you should use the option -X
too. The utree fonts for xterm define some nice special
graphical characters, i.e. for the scrollbars, which are
enabled by this option. Calling utree with the command
line option -V informs you, if your utree version supports
xterm mouse usage and utree fonts support. The mouse
works fine for all xterm versions supporting the capabil-
ity Send MIT Mouse Row & Column on Button Press as
described in the document xterm Control Sequences and is
tested with xterm from X11R4 and X11R5 and some other ter-
minal emulators (e.g. scoterm).
Mouse input is detected if a mouse button is pressed.
Dependent on the pressed button and the position of the
mouse cursor on the screen several utree commands are
invoked. Currently distinguished are two buttons only,
the left button and the other button, which can be the
middle or the right button on three-button-mice. Also,
mouse button actions are static and not user-settable in
this version of utree.
On menus the left button returns the menu item pointed to
by the mouse cursor as lowercase character, the other but-
ton returns the menu item as uppercase character. Depen-
dent on the pressed button the selected commands are
therefore invoked for the current directory or file or the
current subtree or tagged files. Pressing the left button
on the menu title on tree and file screen switches the
menu from the default to the user defined menu commands
and vice versa. The other button pressed on the menu
title returns the REFRESH command (C-l).
On scrollbars the following commands are invoked: on the
top line of the scrollbar the left button scrolls down one
line, the other button moves to beginning. On the bottom
line of the scrollbar the left button scrolls up one line,
the other button moves to end. On the other lines of the
scrollbar the left button moves down one page, the other
button moves up one page.
On tree screen you can move to a directory by moving the
mouse cursor to this directory and pressing any button.
If the directory is already selected the left button
changes to the file screen of this directory, the other
button changes to the file screen of the parent directory.
Pressing the left button on the echo line changes to the
file screen of the current directory. On the file window
the left button enlarges, the other button shrinks the
file window one line. On the separator line the left but-
ton toggles the sort flag from lexical sort to time sort
and vice versa, the other button calls the zoom command.
On the file screen you can move to a file by moving the
mouse cursor to this file and pressing any button. Is the
file already selected the other button changes to the file
screen of the parent directory. Is the current file a
directory the left button changes to the file screen of
this directory. On the echo line the left button returns
to the tree screen.
In the line editor the left button selects and accepts the
input, the other button breaks the editor.
COLOR USAGE
Some utree versions (compiled with the flag USEANSICOLORS)
can use colors instead of video attributes if utree is
called with the command line option -C and the color capa-
bilities are defined in the termcap or terminfo terminal
capability libraries. Calling utree with the command line
option -V informs you, if your utree version supports ANSI
colors. Currently all color settings are static and not
settable. This works fine on terminal types with ANSI
compatible color capabilites like ansi-console, AT386,
colxterm, hft and some others more.
ENVIRONMENT
UTREE Some boolean and numerical settings
for utree
UTLIB Directory for utree help pages and
startup files
HOME User's home directory
TERM Terminal type
EDITOR File editor
PAGER File pager/viewer
SHELL Interactive shell for shell escape
FILES
HOME/.utreelist Tree list file of user's filesystem
HOME/.utreehist History list of shell commands
HOME/.utree User's utree startup file containing
variables and filetype commands defi-
nitions
UTLIB/utree Global utree startup file containing
variables and filetype commands defi-
nitions
UTLIB/utree-TERM Global key bindings for terminal type
TERM
HOME/.utree-TERM User's key bindings for terminal type
TERM
UTLIB/utree.help Utree help pages
BIN/utree.backup Backup shell script or program
BIN/utree.mklist Create directory tree list shell
script
BIN/utree.prlist Display or print a formatted tree list
file
UTLIB can be a system default directory containing library
files (i.e. /usr/local/lib) defined at compile time or a
directory defined in the environment variable UTLIB. BIN
is a public directory containing executable files (i.e.
/usr/local/bin) and should be included in the command
search path environment variable PATH.
SEE ALSO
utree.prlist(1L)
cp(1) grep(1) ls(1) mv(1) rm(1)
du(1) mkdir(1) rmdir(1)
find(1) sh(1)
X(1) xterm(1)
BUGS
Changes in filesystem after shell escape or editor session
are not always detected.
Directory tree depth >32 may be confusing.
Screen sizes smaller than 80x24 may be confusing.
Symbolic links to directories may be confusing.
On most BSD and POSIX systems changing owner and/or group
of files for normal users is not allowed.
AUTHOR
Peter Klingebiel
COPYRIGHT
(C) 1991/1992 Peter Klingebiel & UNIX Magazin Munich
Permission is granted to copy and distribute utree in
modified or unmodified form, for noncommercial use, pro-
vided (a) this copyright notice is preserved, (b) no
attempt is made to restrict redistribution of this file,
and (c) this file is not distributed as part of any col-
lection whose redistribution is restricted by a compila-
tion copyright.