Monday, January 15, 2007

DOS is not dead.

Windows:
Anyone remember DOS? It is still useful today.
To create a few folders with one command, use the “md" command:
Open a command prompt.
md this is more than one folder – will create 6 folders – this, is, more, than, one, folder
now delete them – rmdir this is more than one folder
To create a folder several folders deep, use:
md this\is\more\than\one\folder – will create a folder called this with a folder called is in it etc….
Creating a single folder with spaces in the name requires adding a double-quote at the beginning:
md "this is one folder" – will create one folder called “this is one folder

Bonus tip: At the command prompt, you can use forward slash (unix style) "/" as a folder divider when using the cd command to change your present working directory:
cd Windows/system32/drivers/etc


Linux:
Quick method for copying an entire directory including subdirectories and files to another directory.
(cd /source/directory && tar cf - . )¦(cd /dest/directory && tar xvfp -)

(My friend Richie pointed out that this could be done using:
cp -av /source/directory /destination/directory
I find that using tar will do the job quicker)

No comments: