Thursday, 16 May 2024, 11:24:28 PM
Main Sign Up RSS
Welcome, Guest
new year countdown
my twitter updates
my fav lines
serials & key

Our poll
Rate my site
Total of answers: 24
Main » Articles » My articles

internal comands of dos

INTERNAL COMMANDS:-

 

 

cd

Change directory

 

  1. cd

     

    cd /home     :   Change the current working directory to /home. The '/' indicates relative to root, and  no matter what directory you are in when you execute this command, the directory will  be changed to "/home".

     

     

    cd httpd    : Change the current working directory to httpd, relative to the current location which is "/home". The full path of the new working directory is "/home/httpd".

     

     cd ..      :       Move to the parent directory of the current directory. This command will make the current

      working directory "/home.

 

      cd ~      :       Move to the user's home directory which is "/home/username". The '~' indicates the users home                                         directory.

 

 

cp

Copy files

 

cp myfile yourfile :    Copy the files "myfile" to the file "yourfile" in the current working directory. This command will       create the file "yourfile" if it doesn't exist. It will normally overwrite it without warning if it exists.

 

cp -i myfile yourfile   :  With the "-i" option, if the file "yourfile" exists, you will be prompted before it is overwritten.

 

cp -i /data/myfile .   :  Copy the file "/data/myfile" to the current working directory and name it "myfile". Prompt before                                          overwriting the file.

 

TIME : This lets you set your systems time.

C:\time 

Current time is 1:46:11.30p 

Enter new time: 

C:\> 

 

You don't need to specify the time to the nearest millisecond like DOS displays it, an hour and a minute will do. Notice the p at the end of the second line. That means it's P.M. You MUST put a p at the end of your new time or else your computer will be set to A.M. You can put an a there if you want an A.M. time, or you can just leave it blank. 

 

EXIT :

 

This exits the current command shell. In windows it will close your DOS window. (Unless you have more than one instance of command.com running). If you are at a real DOS prompt (No windows in the background) nothing will happen.

If you start another instance of command.com (By typing 'COMMAND') then you will have two shells running. Anything you do here will not affect the previous shell. Example: if you change your path statement in a secondary shell, when you exit all your environment variables will be lost and go back to what they where in the first shell's environment. 

 

 

RD and RMDIR  :

 

RD will Remove a Directory. Use RD followed by the name of the directory you wish to delete. You must empty the directory first or you will just get an error message from DOS. Since DOS 5.00 there has been a nifty utility called DELETREE which doesn't care if the directory has files in it. 

 

 md or mkdir :

 

Makes a new directory. The parent of the directory specified will be created if it does not already exist.

md directory

Equivalent to the Unix command mkdir.

 

del or erase :

 

Deletes one or more files.

This command is used to delete a particular or more files.

Syntax:

del filenameerase filename

Options

*.*  All files in current folder*.* /s all files in current folder and sub folders, 

Equivalent to the Unix command rm.

Equivalent in RT-11/RSX-11/OpenVMS operating systems line is delete command which can be contracted to del.




Category: My articles | Added by: nikesh (21 Jun 2011)
Views: 840 | Rating: 5.0/1
Total comments: 0
Name *:
Email *:
Code *: