Skip to main content

View Windows command line history

In the Windows command line, press the F7 key to view a history of all the commands that have been entered in that window.


Pressing the up or down keys allows you to browse through all commands and once highlighted pressing enter will perform the previous command.

Using DOS doskey command

Doskey is an MS-DOS utility that allows a user to keep a history of commands used on the computer. Doskey allows frequently used commands to be used without having to type the command each time its needed.

Syntax:

DOSKEY [/REINSTALL] [/LISTSIZE=size] [/MACROS[:ALL | 
:exename]]   [/HISTORY] [/INSERT | /OVERSTRIKE] [/EXENAME=exename] 
[/MACROFILE=filename]   [macroname=[text]]


/REINSTALLInstalls a new copy of Doskey.
/LISTSIZE=sizeSets size of command history buffer.
/MACROSDisplays all Doskey macros.
/MACROS:ALLDisplays all Doskey macros for all executables which have Doskey macros.
/MACROS:exenameDisplays all Doskey macros for the given executable.
/HISTORYDisplays all commands stored in memory.
/INSERTSpecifies that new text you type is inserted in old text.
/OVERSTRIKESpecifies that new text overwrites old text.
/EXENAME=exenameSpecifies the executable.
/MACROFILE=filenameSpecifies a file of macros to install.
macronameSpecifies a name for a macro you create.
textSpecifies commands you want to record.

UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays command history; ALT+F7 clears command history; F8 searches command history; F9 selects a command by number; ALT+F10 clears macro definitions.


At the command prompt, enter the following command:
DOSKEY /history

When you do so, you'll see a full listing of all the commands that you've entered in a current session.

Comments

Popular posts from this blog

20 perl programming tips

1. List all Installed Perl Modules from Unix Command Line Get a list of all installed perl modules as shown below. $ perl -MFile::Find=find -MFile::Spec::Functions -Tlw -e 'find { wanted => sub { print canonpath $_ if /\.pm\z/ }, no_chdir => 1 }, @INC' /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/Filter.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/LinkExtor.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/PullParser.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/Parser.pm /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi/HTML/TokeParser.pm ..... In the above example, File::Find  and  File::Spec::Functions  module are used to list all installed modules. -M option  loads the module. It executes  use module  before executing the script -T option  enables taint checking, which instructs perl to keep track of data from the user and avoid doing anything insecure w...

Perl and Excel: How to Read, Write, Parse Excel Files using Perl

If you want to manipulate excel files programmatically, you can use Perl Spreadsheet module, which provides an object interface that makes it easier to create and parse Excel files. Install Spreadsheet WriteExcel Module Method 1: Standard install using make Download the zipped tar file of  Spreadsheet-ParseExcel  and  Spreadsheet-WriteExcel  from cpan. Untar and unzip the module as follows: tar -zxvf Spreadsheet-WriteExcel.tar.gz cd to the directory the tar creates. Execute the steps below to to install the Spreadsheet-WriteExcel module. perl Makefile.PL make make test make install Use the above procedure to install Spreadsheet-ParseExcel also. Method 2: CPAN.pm install If you have CPAN.pm configured you can install the module as follows: perl -MCPAN -e 'install "Spreadsheet::WriteExcel"' perl -MCPAN -e 'install "Spreadsheet::ParseExcel"' For additional installation help refer to: How To Install Perl Modules Manually and Using ...

How to Connect to MySQL from Perl

How do I connect to a MySQL database from a perl program? use perl DBI module to connect to a MySQL database as explained below. If you don’t have perl DBI and DBD::mysql module installed, install perl module using cpan as we discussed earlier. # perl -MCPAN -e shell cpan> install DBI cpan> install DBD::mysql On a very high level, you’ll have to do the following three steps to connect to a MySQL database and get data. 1. Connect to the MySQL Database In the DBI module, you’ll use the connect function as shown below. $dbc = DBI->connect($source, $username, $password) DBI->connect function takes the following three arguments: $source – This is in the format of “DBI:mysql:[database]:[hostname]”. Replace the [database] and [hostname] with values from your system. In the example shown below, it is connecting to the database called “mycompany” that is running on the localhost. $username – The username that is used to connect to the MySQL database. $pass...