
PeopleCode.ai
Basic Terminal Commands (Windows)
The following instructions are for Windows computers.
​
Windows Command Line Tutorial
The Command Prompt (cmd) and PowerShell allow you to type commands to instruct your computer. You can create and organize files, run programs, and more. Like File Explorer, the Command Prompt and PowerShell let you navigate through the file system. Instead of clicking on a folder, you type dir to list files. You can change directories with cd folder-name, and you can determine your current location using cd in cmd or pwd in PowerShell.
1: Add Your User Folder to Quick Access
Before you start using the command line, make sure your user folder is easily accessible in File Explorer:
-
Open File Explorer (Win + E).
-
In the address bar, type %USERPROFILE% and press Enter to go to your home folder.
-
Right-click the Quick Access section in the left sidebar and select Pin current folder to Quick Access.
Now you can quickly access your home folder from File Explorer anytime.
​
2: Open the Command Line
You can use either the Command Prompt or PowerShell:
Open Command Prompt (cmd):
-
Press Win + R, type cmd, and press Enter.
-
Alternatively, press Win + S, type cmd, and select Command Prompt.
Open PowerShell:
-
Press Win + X and select Windows PowerShell.
-
Alternatively, press Win + S, type powershell, and select Windows PowerShell.
A terminal window will open, ready for input.
​
3: Use the Command Line to Explore the Filesystem
3.1 Print the Current Directory
In cmd, type:
cd
In PowerShell, type:
pwd
This will show your current location in the file system.
3.2 List Files
In cmd, type:
dir
In PowerShell, type:
ls
This will list all files and folders in your current directory. Compare the output with what you see in File Explorer.
3.3 Change Directories
To navigate into the Documents folder:
cd Documents
​
Confirm your new location by checking the directory with dir.
To return to your home directory:
cd %USERPROFILE%
cd ~
To move up one level:
cd ..
​
4: Experiment and Compare
Now that you know the basics, try the following:
-
Use cd to navigate different folders and compare locations in File Explorer.
-
Use dir /a to view hidden files in cmd (or ls -Force in PowerShell).
-
Open File Explorer and create a new folder, then confirm its existence by listing files in the command line.
Essential Commands
CommandDescription
cd -- Change directory
cd .. -- Move up one level
cd \. -- Go to the root of the drive
dir -- List files in the directory (use dir /a to show hidden files)
mkdir folder-name -- Create a new directory
rmdir folder-name -- Remove an empty directory
del file-name -- Delete a file
copy file1 file2 -- Copy file1 to file2
move file1 folder-name -- Move a file to another folder
type file.txt -- Display the contents of a file (use cat file.txt in PowerShell)
cls -- Clear the screen
exit -- Close the terminal session
​
Knowing how to navigate the command line will help you run tools and apps efficiently as you develop software or manage your system.