At Work: January 2007 Archives

2007 Jan 31

Most of the time i do work with the linux shell, so most of the time i will be using ls to display files the current folder. However, in windows the command to display files is dir. i would always interpret cmd as a linux shell.

Back with the good old days, we could use doskey to assign shortcuts to DOS commands. So, we could just assign ls to its windows equivalent like this:

C:\> doskey ls=dir

Now, whenever we type ls, dir command is executed. We could also do that in Windows XP Command prompt, but the problem is after you have closed the window the doskey is also removed as well and we have to type it again every time we would run cmd.

There is actually a work around with that, we could modify our cmd shortcut in the start menu to add the doskey instructions there so that everytime the cmd is loaded the extra line is also executed as well.

cmd-shortcut.jpg cmd-properties.jpg

i have modified my shortcut target from


%SystemRoot%\system32\cmd.exe

to

%SystemRoot%\system32\cmd.exe /k doskey ls=dir

the /k makes the window stay after the doskey is executed. For more additional options about cmd you can issue the command

C:\> cmd /?

here are a few common options:
/C Carries out the command specified by string and then terminates
/K Carries out the command specified by string but remains
/S Modifies the treatment of string after /C or /K
/Q Turns echo off
/D Disable execution of AutoRun commands from registry


Alternatively, you could also change the value of your registry at

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

to

Value name: AutoRun
Value data: doskey ls=dir

Actually, its better to use the registry option because after adding the code to the shortcut properties; the code completion for the command prompt no longer works.

2007 Jan 30

Making a tarball and adding a mysqldump to it then naming it as example.tar:


shell> tar cvf example.tar dump.sql


Making a tarball and adding all files in the current directory then naming it as example.tar:


shell> tar cvf example.tar *


Compressing the tarball by zipping it (.gz):


shell> gzip example.tar


Restoring a tarball gzip file example.tar.gz


shell> gunzip example.tar.gz
shell> tar xvf example.tar

About this Archive

This page is a archive of entries in the At Work category from January 2007.

At Work: October 2006 is the previous archive.

At Work: February 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Recent Activity

Friday

  • tildemark tweeted, "im so sleepy. Zzzzzzzz"

Sunday

  • tildemark tweeted, "some of my scipts are not working with godaddy. but works fine on the others. not mention their poorly coded admin page"

Today

  • tildemark tweeted, "so many pending tasks i need to finish. need more coffee !!!"
  • tildemark tweeted, "@gmtristan i dont think that is true."

Today

  • tildemark tweeted, "how does godaddy subdomain behaves? i have some problems with it on my scripts. it does not seem to accept query strings.."

Monday

  • tildemark tweeted, "i had a hard time removing the error messages generated by surf side kick. i ended up uninstalling most of my applications."

Sunday

  • tildemark tweeted, "i got hit by surf side kick and im getting numerous error messages on my screen. tskkkkk"

Saturday

  • tildemark tweeted, "check boxes, i didn't know they can also be complex"
  • tildemark tweeted, "this smart bro internet speed is depressing, i thinking of filling a complaint to the DTI next week."

Friday

  • tildemark tweeted, "the seminar turned out to be leadership training. it was fun, learned alot. i have already attended numerous seminars but this is different."