Tuesday, October 8, 2019

Important cmd commands for daily use


Important cmd commands for daily use


In windows, we do some tasks like move any files, delete files, remove directory, move one directory to other etc; in our daily life by manually by using mouse and keyboard. But windows command prompt provides some commands to do these tasks in efficient way & also important for developers.

DIR Command: It is use to display files and folders(directories) of current directory.

For Example:
dir

CD Command: It is use to change directory.

For Example:
cd test1\test1-2

Now you are in under test1-2 directory.



cls Command: It is use to clear cmd screen.

For Example:
cls

mkdir / md Command: Here both commands mkdir & md is use to make directory.

For Example:
mkdir test2

Here test2 is directory name, which we want to make.

md test3
Here test3 is directory name, which we want to make.

To check directory made or not, use dir command.
dir



ren Command: It is use to rename file or directory.

For Example:
ren test1 test5

Above command will change directory name from test1 to test5. To change file name:

ren test1.txt test3.txt
Above command will change file name from test1.txt to test3.txt.



move Command: It is use to move files from one place to another place.

For Example:
move test1.txt test3

Above command will move test1.txt file from current directory to test3 directory, when test3 directory presents in current directory. Suppose our current directory is "C:/example/test1/" and our files test1.txt is here & we have made a directory test3 here. then above command is fine. But if test3 directory is  present in "C:/example/", then we use below command to move file:

move test1.txt ../test3

del / erase Command: It is use to delete file or files.

For Example:
del test1.txt

Above command will delete "test1.txt" file from current directory.

erase test1.txt
Above command will also delete "test1.txt" file from current directory.

To delete all text files from current directory,
del *.txt

To delete all files from current directory,
del *.*

rmdir Command: It is use to remove directory, If it is empty.

For Example:
rmdir test3

Above command will remove test3 directory, If it is empty. To remove multiple empty directory:
rmdir test1 test2 test3 test4

Above command will remove all directories(test1, test2, test3, test4)

But if we want to remove directory, which is not empty, use below option:
rmdir test4 /s

Above command will ask "Are you sure(y/n)", press y. It will remove test4 directory.

takslist Command: It will display all tasks list, which is running in your system. Every task in your system is defined as process ID means PID.

For Example:
tasklist




If we want to kill any task, we use taskkill command with their process ID.
taskkill -pid 5392

If you have any question, write at phpeasysolutions@gmail.com

No comments:

Post a Comment