uvhelp - Help Menus for Unix commands & VU scripts

Here is a free, simple,& effective help menu system for command line users running Korn or Bash shells on Unix, Linux, or Windows systems. Windows can run Korn or Bash shells with SFU (Services For Unix), a free download from Microsoft.

See the link at the bottom of this email to download the help menus & over 100 scripts that make it much easier to use unix commands.

sample help menu - find/remove files older than 1 year

For example if you wanted to remove backup files older than 1 year, you might use the unix 'find' command with '-mtime', '-exec',& 'rm' as follows:

 find /u3/backups -mtime +365 -exec rm -f {} \:

But how many of you can understand & remember this syntax ? The uvhelp menus & the 'rmold1' script make this much easier:

 #1. uvhelp    <-- display main-menu (list of submenus v11,v12,etc)
     --> page down to submenu for removing old files (v15)
     --> q     <-- quit main-menu (to free up command line)

 #2. v15       <-- display sub-menu with examples of removing old files
     --> determine script & arguments required 'rmold1' (& 'lsold1' ?)
     --> q     <-- quit sub-menu - so you can enter command
 #3  --> rmold1 /u3/backups +365  <-- remove files older than 1 year
  • you might 1st want to simply 'list' the files older than 1 year
  • to become confident in using these scripts

 #3a. lsold1 /u3/backups 365       <-- list files older than 1 year
      ======================           (before removing as below)

 #3b. rmold1 /u3/backups +365 -f   <-- remove files older than 1 year
      ==========================       with -force option (no prompt y/n)

 #3c. rmold1 /u3/backups +365 -i  <-- Alternative with '-i' option
      ==========================      to prompt y/n remove ? on each file

 #3d. mvold1 /u3/backups /u4/archive +365  <-- Alternative to move vs remove

Goto:   Begin this document End this document UVSI Home-Page

more examples of uvhelp scripts

  • List Long files in directory & pipe to More
  • same as 'ls -l | more', but much easier to key
  • press space bar to see next page, or enter to see next line
  • same as llm, but sorted by file Size (largest 1st)
  • same as lls, but Reverse sorted by file Size (smallest 1st)
  • same as llm, but sorted by date/Time of file creation (latest 1st)
  • same as llt, but Reverse sorted by date/Time (oldest 1st)
  • same but counts files & lines within each file, for example:

demo llc - list files with line counts

 llc help      <-- List files in help menus directory with counts
 File#   Lines
     1     114 -rwxrwxr-x 1 uvadm apps 4745 Apr  6 19:00 help/uvhelp
     2      58 -rwxrwxr-x 1 uvadm apps 2348 Apr  5 10:57 help/v11
     3     118 -rwxrwxr-x 1 uvadm apps 4284 Apr  5 14:55 help/v12
     4     100 -rwxrwxr-x 1 uvadm apps 4295 Apr  5 10:58 help/v13
                       --- 23 files omitted ---
    28     103 -rwxrwxr-x 1 uvadm apps 3590 Apr  7 11:00 help/v92
    28 files,      3060 total lines in directory help

v12 - counting Lines & Files in Directories

  • unix Word Count, examples
  • similar to 'ls -l | more', but with file seq# & line counts/file
  • Count Files in a Directory (listing each file)
  • Count Files in a Directory, Total only (1 line answer)
  • Count Files in Directories within a parent Directory
  • Count Files in a Directory with a Pattern on any line in any file
  • Count Lines in 1 File
  • Count Lines & Files in a Directory
  • Count Lines in a File with a specified Pattern
  • Count Lines in all Files of a Dirctory with a Pattern

The help menus provide samples of using each of the above scripts. Here is 1 such sample using the 'clfpd' script.

clfdp - Count Lines in all Files in Directory with a Pattern

 clfdp help 'grep'
 0001 lines of 0000120 contain "grep" in file #0001 - help/uvhelp
 0013 lines of 0000155 contain "grep" in file #0003 - help/v12
 0003 lines of 0000044 contain "grep" in file #0007 - help/v21
 0013 lines of 0000051 contain "grep" in file #0008 - help/v22
 0030 Total lines contain "grep" in 0004 of 0029 files in directory: help

Goto:   Begin this document End this document UVSI Home-Page

Expand help menus for your own purposes

It is incredibly easy to create the help menus. Simply insert "more <<'EOF'" at the beginning of your text, 'EOF' at the end, make the file executable,& store your new help file in the help/ subdir, which could be in your homedir, or anywhere as long as it is in the PATH defined in your profile or the common_profile to make available to all users.

sample User sub-menu

      # u11 - help sub-menu for payment system
      #      - by Joe Blow, ABC Corp, April 09/2014
      more <<'EOF'
                        ** u11 - payment system **
      ----------- payment system instructions -------------
      --------------------- details -----------------------

Links to more information

 http://www.uvsoftware.ca/uvhelp.htm     - all documentation for uvhelp system
 http://www.uvsoftware.ca/uvhelp.htm#V91 - Download & Install help menus & scripts
 http://www.uvsoftware.ca/uvhelp.htm#V92 - Creating your own help menus
 http://www.uvsoftware.ca                - UV Software Home Page
 http://www.uvsoftware.ca/uvintro.htm#G1 - customer list & reference letters
 http://www.uvsoftware.ca/uvprices.htm   - prices & partner agreements
 http://www.uvsoftware.ca/libuvhd.htm    - download uvhd FREE utility
 http://www.uvsoftware.ca/news/          - all newsletters past & present

I invite your feedback. Let me know if these news letters are useful to you, and any suggestions you may have for improvements.

Thank You Owen Townsend owen@uvsoftware.ca www.uvsoftware.ca

Goto:   Begin this document End this document UVSI Home-Page