× Back

MS-DOS Command

Some of the basic commands

dir

  • This command show all the files and folder in a directory.

cd

  • Using this command we can change directories.

mkdir

  • Using this command we can make a directory.

copy con filename.extension

  • Creates a file
  • Then we can write content inside it if we want and when we are done then do CTRL + z and then press 'enter'.

type filename.txt

  • Displays the content inside a file.

ren oldname.txt newname.txt

  • Helps renaming a file.

copy <source> <destination>

  • Copies particular file to a destination folder.

move <source> <destination>

  • Moves particular file to a destination folder.

attrib +h filename.txt

  • Hiding a particular file

attrib -h filename.txt

  • Unhiding a particular file

edit filename.txt

  • Use to edit a file in an editor.

del filename.txt

  • Deleting a particular file

rd/rmdir

  • If we want to delete an empty directory.
  • For deleting we have to be outside of the directory.

tree

  • Shows tree like structure of all files and folders in a directory.

deltree <direcotry path>

  • If we want to delete a non empty directory

time

  • Shows time in that particular moment.

Some concepts

Absolute vs Relative path

  • The Absolute path always start from the root directory (/). For example, /home/abc/
  • A relative path starts from the current directory.