The Windows Command Prompt (CMD) is a powerful tool that allows users to perform a wide range of tasks using text-based commands. Here’s a list of basic CMD commands along with their descriptions:
Navigating Directories
cd
: Change Directory. Use this command to navigate to different folders in your system.
cd path_to_directory
dir
: Displays a list of files and subdirectories in a directory.
dir
File Management
copy
: Copies one or more files to another location.
copy source_file destination_file
del
: Deletes one or more files.
del filename
ren
: Renames a file or files.
ren old_filename new_filename
mkdir
: Creates a new directory.
mkdir new_directory
Viewing File Contents
type
: Similar to the Linuxcat
command,type
displays the contents of a text file.
type filename
This command is used to display the contents of specified files and is analogous to the Unix cat command1.
Finding Files
dir /s
: Similar to the Linuxlocate
command,dir /s
searches for files and directories in the specified path and all subdirectories.
dir filename /s
This command is useful when you need to find a file but only know part of the name or the file type2.
System Operations
ping
: Checks the network connection and latency.
ping ip_address_or_hostname
ipconfig
: Displays all current TCP/IP network configuration values.
ipconfig /all
Getting Help
help
: Provides a list of commands and their usage.
help
whoami
: Similar to the Linuxwhoami
command, this command in Windows displays the user name associated with the current user logged into the system.
whoami
This command will output the domain and username of the currently logged-in user in the format ‘domain\username’. It’s a straightforward and efficient way to verify the user account that is running commands in the CMD environment