OS commands in Windows allow users to perform file, folder and system-related operations using the Command Line Interface. These commands provide a direct way to manage the operating system through text-based instructions.
CLI Commands (Command Line Interface)
The Windows Command Line Interface (CLI) allows users to interact with the operating system using commands instead of a graphical interface. To Open Command Prompt:
- Press Windows + R
- Type cmd
- Press Enter

This opens the Command Prompt window where you can execute commands.
Common Commands Used in Windows CLI
1. Current Directory: To display all files and folders present in the current working directory, the dir command is used. It shows files, subfolders and system information related to the directory.
dir
This command helps in viewing directory contents before performing any file operations.
2. Change to Desktop: To move the command prompt from the current directory to the Desktop folder, the cd command is used along with the folder name.
cd Desktop
The user must be inside the user directory for this command to work correctly.
3. Clear Screen: To clear all previous commands and outputs from the command prompt window, the cls command is used.
cls
This command only clears the screen and does not delete any data.
4. Go Back One Directory: To move one level up from the current directory to its parent directory, the cd .. command is used.
cd ..
This command is useful while navigating backward in the directory structure.
5. Create Directory: To create a new folder in the current directory, the mkdir (make directory) command is used.
mkdir FolderName
Replace FolderName with the name of the directory to be created.
6. Remove Directory: To delete an existing directory, the rmdir command is used.
rmdir FolderName
The directory must be empty before it can be removed.
7. Display System Date: To display or modify the system date, the date command is used.
date
Press Enter without typing a new date to keep the current system date unchanged.
8. Copy Files: To duplicate a file from one location to another, the copy command is used.
copy source.txt destination_path
The original file remains in its original location.
9. Delete File: To permanently delete a file from the system, the del command is used.
del filename.txt
Deleted files cannot be recovered from the Recycle Bin.
10. Erase File: The erase command performs the same operation as the del command and deletes files permanently.
erase filename.txt
It is simply an alternative command for deleting files.
11. Move File: To move a file from one directory to another, the move command is used.
move file.txt destination_path
The file is removed from the source location after being moved.
12. Rename File: To change the name of an existing file, the ren or rename command is used.
ren oldname.txt newname.txt
Only the file name changes; the file content remains the same.
13. Shutdown System: To shut down the Windows system using the command line, the shutdown command is used.
shutdown /s /t 0
The /t 0 parameter shuts down the system immediately.
14. Exit Command Prompt: To close the Command Prompt window and end the current session, the exit command is used.
exit
This command terminates the active CLI session.