Blog Posts
Help Sheet for vi/vim editor
Tips Tutorial
October 29, 2006 | COMMENTS

Forgot a command or a shortcut in your favorite text editor ? Here is a small help sheet with most used commands !

I read it some times for remember me some useful commands that can help you to work faster with vi or vim (Vi IMproved).

Vi help sheet thema : insert mode, search commands, edit commands, navigation commands, file commands...

vi help sheet ** Download it **: vi help sheet in pdf

CLI workaround for Windows XP : Using GREP (QGREP)
Shell Tips
October 21, 2006 | COMMENTS

In our list of "CLI workaround for Windows XP", a missing command is GREP. Now, you can have a GREP-Like command with the DOS command QGREP. Get the [Windows Server 2003 Resource Kit tools][1] on microsoft.com.

# display help

QGREP /?

usage: qgrep [-?BELOXlnzvxy][-e string][-f file][-i file][strings][files] -? - print this message
-B - match pattern if at beginning of line
-E - match pattern if at end of line
-L - treat search strings literally (fgrep)
-O - print seek offset before each matching line
-X - treat search strings as regular expressions (grep)
-l - print only file name if file contains match
-n - print line number before each matching line
-z - print matching lines in MSC error message format
-v - print only lines not containing a match
-x - print lines that match exactly (-BE)
-y - treat upper and lower case as equivalent
-e - treat next argument literally as a search string
-f - read search strings from file named by next argument (- = stdin)
-i - read file list from file named by next argument (- = stdin)
White space separates search strings unless the argument is prefixed with -e, e.g., ‘qgrep "all out" x.y’ means find either "all" or "out" in x.y, while ‘qgrep -e "all out" x.y’ means find "all out".

# Example for UNIX-Like regexp search

QGREP -X "[a-Z]" MYFILE.TXT

System Requirements

Supported Operating Systems: Windows Server 2003; Windows XP

  • 30 MB of free disk space
  • Windows XP
  • Windows XP SP1
  • Windows Server 2003 family
CLI workaround for Windows XP : Using LIST (LESS-Like)
Shell Tips
October 21, 2006 | COMMENTS

In our list of "CLI workaround for Windows XP", a missing command is LESS. Now, you can have a LESS-Like command with the DOS command LIST. Get the [Windows Server 2003 Resource Kit tools][1] on microsoft.com. While not 100% functionally-equivalent to most versions of the UNIX LESS command, list does support text searching and bi-directional scrolling. This command is useful when examining log files (such as web server logs), configuration files, and software "read me" files when you don’t want to open a Notepad window.

Usage

filename
REQUIRED - The filename you wish to view

-s:STRING
Performs a case insensitive search and highlights the first line matching your search text

-g:LINE#
The list display will jump to the specified line number, displaying it at the bottom of the screen. Note that list starts its line numbering from line 0.

While running the list command, here are a few of the functions you may perform:

Cursor keys
Use the cursor keys to scroll through the file. If the file is too wide to view onscreen at once, the left and right cursor keys will be active.

Page Up, Page Down Keys Scrolls through the text file up or down one page at a time

Home, End Keys Jumps to the beginning or end of the file

W
Toggles text word-wrap

Q or the ESC key Quit the list display

/ Perform a case-sensitive search of the string you specify

\ Perform a case-insensitive search of the string you specify

n or F3
Searches for the next match to the search string

N Searches for the previous match to the search string

G Jump to the specified line number

F Open a new file without going back to the DOS prompt

? Displays a full list of commands

Note that by entering more than one filename after the list command you can view more than one file. Although only one file is displayed at a time, the following commands switch between files specified on the command line:

CTRL PAGE-DOWN Displays the next file specified on the command line, or wraps to the first file.

CTRL PAGE-UP Displays the previous file specified on the command line, or wraps to the last file.

System Requirements

Supported Operating Systems: Windows Server 2003; Windows XP

  • 30 MB of free disk space
  • Windows XP
  • Windows XP SP1
  • Windows Server 2003 family
Customize your DOS/CMD Prompt
Shell Tips
October 21, 2006 | COMMENTS

If you want to tune your PROMPT you just need to use... the PROMPT command ! By default the prompt is set to the current path, but you can customize it a little.

# Display prompt help

PROMPT /?

# Customize your prompt

PROMPT $T $D$_$P $F

# Will give this result in my cmd window

17:11:55,31 sam. 21/10/2006

D:\Documents and Settings\Nicolas>

CLI workaround for Windows XP : Using TAIL
Shell Tips
October 21, 2006 | COMMENTS

If you are an addict of the command line interface whateve the OS you use, you probably already had difficulties to administrate some Windows XP box remotely. Tips ! Get the [Windows Server 2003 Resource Kit tools][1] on microsoft.com you could install lot of usefull tools and especially tail !

# display help

tail /?

# display last ten lines of a file

tail FILENAME

# display last thirty lines of a file

tail -30 FILENAME

# keep accessing file, displaying new lines as necessary.

tail -f FILENAME

System Requirements

Supported Operating Systems: Windows Server 2003; Windows XP

  • 30 MB of free disk space
  • Windows XP
  • Windows XP SP1
  • Windows Server 2003 family
  • ...