Favorite Aliases

This document comes from the thread entitled "My Favorite Aliases" that ran on the J.P. Software forum (PCVENB section 10 on Compuserve) in July and August 1994. The original files are long.al (with the original messages) and short.al (with an edited version) are contained in a compressed file Compressed archive.

These alias examples date from pre-Windows 95 days when MSDOS still challenged Windows 3.X as the predominant operating system on PCs. Please note that some aliases may refer to additional utilties, specific files and/or to the particular configuration of each individual computer. For aliases to work on your computer, you must adjust them accordingly. By the date of the original messages, these files were written for 4DOS version 5.0. Some of these aliases may have been made obsolete by added features to 4DOS version 6.0. To see more recent alias examples, check out this page.

Original collecting and editing was done by M. Sean Fosmire, Marquette, Michigan, CIS 76207,1120

Attributions appear before each section. No one claims original authorship, except as may be noted.

Sean Fosmire

ca=copy %1 %2 %3 %4 %5 %6 %7 %8 %9 a\
allows for entry of several filespecs for quick copy to A
sc=select /od copy (%2*.*) %1
organizes list of files then allows selection for copying 1st RP is the destination directory
sca=select /o-d copy (%1*.*) a\
combines the best of the two above presents the current files, in reverse chronological order to permit selection for copying to A this way, the most recently added or changed files are on top I also have "sm" and "sma" which do the same thing for the move command
ix=dir/djs > index
This produces an ASCII file listing all files in the current directory and all subdirectories. If run from C\, it will list all files in all directories, with summary information.
sl=select list (%1*.*)
Allows selection of file for use of the 4DOS List command

NOTE on replaceable parameters in aliases I frequently use the last RP in an alias as the first character in a wildcard see examples above and one below this allows for quick narrowing by filename by entering one or more letters e.g., with "d" below, enter "d ca" to list all files beginning with "ca"

d=dir/jp %1*.*
the "jp" is my preference -- separate extensions, stop display by page
fre=free c d e f g j n > c\freedoc ^ type c\freedoc
uses the "free" command to display free space on all current drives

Michael Geary

al*ias=*alias
Make it easier to type the ALIAS command
ea=edit c\txt\alias.lst
Edit Aliases
la=ua * ^ alias /r c\txt\alias.lst && echo Aliases loaded
Load Aliases
ua=unalias
Clear Aliases
l*cmd=(%&) | list /s
List the output of a command
This just runs any command and pipes its output to the LIST command. Very simple, but extremely useful. L MEM /C is a typical use, or even L DIR. Alternative, to pipe output to a file and then view it
l*cmd (%&) >C\TEMP\LCMD%_shell.LST ^ list C\TEMP\LCMD%_shell.LST
In case I run LCMD in more than one DOS session under Windows, the %_shell gives a unique file name to each of the "pipe" files. You could use %@unique for this, but I wanted to be able to pick my own file name.
With the LCMD alias, you could cut FRE down to
fre=free c d e f g j n
and type L FRE at the C> prompt. (Or, of course, include the L at the beginning of the FRE alias itself if you always run it that way.)
in=pushd %1 ^ %2& ^ popd
Run a program in a specified directory IN <path> < program> This replaces all the batch files that wrap PUSHD and POPD around some program that likes to be run from its own directory.

My last one for now is a variation on this theme. I normally run my DOS sessions in 50 line mode. A fair number of DOS programs have to run in 25 line mode. Most of those are smart enough to at least switch to thame mode first, but some are not. They leave my screen in 50 line mode and run in the top half of the screen, leaving the bottom half with whatever was on it. Anyone who uses 50 line mode has run into this and may have batch files that call MODE 80,25 before running such programs and MODE 80,50 after. The easy way is

in25=mode 80,25 ^ %& ^ mode 80,50
IN25 and IN combine well.

To run V Communications' System Commander, I use

scin=in25 in c\sc *scin

Howard Goldstein

This is an alias for the TIME command. If entered with no operands, the date and time are displayed as with the normal TIME command but the user is not prompted for a new time. If a parameter is given, the time is set.

Note that this should all be entered on one line and that the caret (^) is used as the command separator

time=iff %#==0 then^keystack enter^*time|echo %@line[con,0]^else^*time %& ^endiff

Variation on above suggested by Mike Bessy with Howard's addition

May I suggest a variation that doe _not_ require that KSTACK be loaded and can also be used under OS/2 or NT (with suitable ParameterChar and CommandSep, of course)

time=iff "%& "=="" then^echo The time is %_time^else^time%& ^endiff

Don E. Groves, Jr.

DATER=(dater_date %+ ECHO %_time)
DATER12=(dater_date %+ dater_time ^echo.)
DATER_DATE=
ECHOS %_Dow %@substr[JanFebMarAprMayJunJulAugSepOctNovDec,
%@eval[(%@substr[%_date,0,2]-1)*3],3] %@eval[%@substr[%_date,3,2]],
19%@substr[%_date,6,2]
DATER_TIME=
ECHOS %@substr[12 1 2 3 4 5 6 7 8 91011,
%@eval[%@substr[%_time,0,2] %% 12*2],2]
%@substr[%_time,2,6]
%@substr[AP,%@int[%@eval[%@time[%_time]/3600/12]],1]M

Note: DATER_DATE and DATER_TIME each go on one long line a piece. -)

They produce the output in the format of

DATER
Tue Aug 23, 1994 002316

and

DATER12
Tue Aug 23, 1994 122403 AM

And yes they are all pipeable to a file or whereever.

Charlie Weesner

My "favorite" three aliases require using NCD (Norton's Change Directory) or LCD (LED's Change Directory). These programs provide direct navigation from any level of the directory tree to any other level (including completion of partial directory names or mis-spellings).

cd=lcd
md=lcd md
rd=lcd rd

If you want to use the original command, rather than the alias, you either"chdir" or "*cd" where the "*" disables any alias replacement of the command.

Niels Schaumann

.*........ pushd%0
walks back up the directory tree from current location, # levels = # dots
popd
nothing fancy, just what it says

I've gotten used to these, been using them for a couple of years. I don't remember who came up with them .... I do remember someone pointing out that the "multiple dots" weren't supposed to work, but hey ..... they sure do!

Gary M. Berg

clear=cls white on blue
Clear the screen
so=%& | list/s
Run a command and pipe stdout into LIST
inside=so string %&
Use a "string" utility to get likely "text" in a file, send it to stdout and view it with LIST
new_4d*os=unalias * ^ alias /r c\cmd\4dos.ali
Reload standard aliases
@@ctrl-T=mapmem
Control/T runs MAPMEM
@@Alt-F4=exit
Alt-F4 types EXIT - similar to closing a winapp

Directory management utilities. Allow changing to a subdir to run a program and then return - will not have changed current directory on any drives.

 popdir_2
 popdir_3
 push_xd         pushd d ^ pushd
 push_xdf        pushd d ^ pushd e ^ pushd
 push_xe         pushd e ^ pushd
 ;   Example of using push and pop routines
 alpha*4         push_xde^cd \alpha4^*a4 %&^popdir_3

ACD is a utility a bit like NCD; use it so an invalid command tries to change to the command line as a sub-directory.

UNKNOWN_CMD=acd %1

Eric Veldhuyzen

You want some nice aliases? How about my dir alias under 4OS2

DIR=iff "%1" eq "" then
   ^set pad=.
   ^else set pad=%1
   ^endiff
   ^iff exist %pad\descript.ion then
   ^*dir /A/Z/P/OgE/J %& 
   ^unset pad
   ^quit
   ^else
   ^*dir /T/A/P/OgE/J %& 
   ^unset pad
   ^quit
   ^endiff

This of course all on one line, but I cut it for readability.

Anthony Williams

4ED*DIT=select %1 describe (*.*)
select files for writing Descriptions
@@Shift-F1=so *alias
 
ADDR*ESS=ks "f%&" 13 %+ list e\mydoc\addr.bk
calls up my address book in Buerg's LIST and finds the name I have requested, e.g. "ADDR Smith"
ALLF*REE=free c %+ free d %+ free e %+ free f %+ free g
 
ALUP*DATE=pushd c\4dos50 %+ COPY ALIAS.LST ALIAS.%@SUBSTR[%_TIME,4,1 ]%@SUBSTR[%_TIME,6,2] /Q %+ alias > alias.lst %+ echo !ALIAS LIST UPDATED! %+ renew %+ popd %+ beep
updates my master alias list, but only after making a backup
DIRARC=dir *.zip;*.arj;*.lzh
selective Dir commands
DIRBAT=dir *.btm;*.bat
selective Dir commands
DIRCMD=dir /k *.exe;*.com;*.btm;*.bat
selective Dir commands
DIREX=dir *.com;*.exe
selective Dir commands
MEMF=free %+ memory
 
NOW=echo It is now %_time on %_dow %_date
 
RENEW=unalias * %+ alias /r c\4dos50\alias.lst %+ echo ALIAS LIST REREAD!
 
RESETN=unset * %+ set /r c\4dos50\var.lst %+ echo ENVIRONMENTAL VARIABLES RESET!
 
SOT*se=%& > %tmp%!tsetmp!.!!! %+ e %tmp%!tsetmp!.!!! %+ del %tmp%!tsetmp!.!!!
puts standard output into my editor via a temp file
TOCP=prompt $p$g %+ set comspec=c\dos\command.com %+ c\dos\command/e2048 %+ c\4dos50\4start %+ set comspec=c\4dos50\4dos.com
when I want to see how hard a time the other 99% of PC users have it!

Allen Cobb

MDF=md %1^move %1.* %1^cd %1
Make a directory and move files with same first name into it.
BDELCOPY=del b%1^copy %1 b
Remove file from B and copy new version to B.
DOC=c\util\list.com c\doc\%1.doc
BAT=c\util\q.exe c\bat\%1.bat
BTM=c\util\q.exe c\bat\%1.btm
Quick access to doc, bat, & btm files.
S4=c\util\q.exe c\bat\set4dos.bat c\4dos\4dos.ini^c\bat\set4dos.bat
Quick setup for 4DOS aliases, etc. (This may be my favorite.)
CD=*pushd
PD=pushd
BD=popd
H=cd \^cdd c\^cls
Directory shortcuts.
MOVE=*move /r
COPY=*copy /r
DELDIR=echo CAUTION! Removing %1 and all subdirs!^pause^del %1 /sxqy
Safety enhancements.
CALC=*set x=%@eval[%&]^echo %x
Standard calculator alias from docs.
UZP=select c\util\pkunzip (*.*) d\ %1
LZP=select c\util\pkunzip (*.zip) -vn list /s
AZP=select c\util\pkzip %1 -a %2& [*.*]
PKZIP shorthand

50,000,000 directory commands.

D=*dir /kmpaou
primary DIR command
DB=*dir b /kpaou
show drive B
DA=*dir /4kmpvou /aa
show everything
D2=*dir /p2ou /v
two columns
DD=*dir /4kmpv
wide, with sizes
DW=*dir /pouwkmv
very wide
DF=*dir /pkmt/a-d/ou
just a file list
DC=*dir /kmpaou *.c
c source files
DR=*dir /adwkm
just directories, very wide
DZ=*dir /su
just space info
DZIP=*dir /kmpaou *.zip
just zips
DX=except (%%&) *dir /oufp
 
DDIR=*dir /ad
just dirs, listed
DRI=dir
yes, I do this too
DIR=*dir /ou
default dir
DH=echo D DA DB DD DW DF DC DZ DX DR DDIR DRI DIR