Table of contents
No headings in the article.
The command line, also called the Windows command line, command screen, or text interface is a user interface that's navigated by typing commands at prompts, instead of using a mouse. It can be a valuable resource and should not be ignored. Using a command line, you can perform almost all the same tasks that can be done with a GUI. However, many tasks can be performed quicker and can be easier to automate and do remotely.
Here are 30 commands that a computer guy should know today itself :
Ipconfig
To get all your IP information
Ipconfig/ all
- To get all of your IP addresses, MAC addresses, DNS servers, DHCP server
Ipconfig/ all | findstr < your_need >
- It is used to get a specific address that we want. Can use findstr in all the commands If you want a new IP address
Sometimes the DCHP lease won’t auto-renew. Then, you might need to manually release and renew your IP address before you can go online.
Ipconfig/release
- To release the IP address.
Ipconfig/renew
To renew the IP address.
Will create a new fresh address for your system. Everything will start afresh
Ipconfig/displaydns
- To display the current DNS settings.
ipconfig/ displaydns | clip
- The clip command is used after a pipe ('|'), To copy all the DNS servers in your system to your clipboard so that you can copy and paste it anywhere.
Ipconfig/ flushdns
Sometimes the DNS resolver cache caches items you’d like to remove. You can clear out all items in the DNS resolver cache by running the code.
This command is useful to remove any negative cache entries when troubleshooting
nslookup < websit_name >
Queries internet domain name servers interactively.
Cls
- To clean up your command prompt
getmac/v
To get all your mac addresses.
Powercfg/energy
- Run your command prompt as administrator.
Used to check if there is any power issue with your computer.
powercfg/ batteryreport
- Gives us the complete report of your battery
assoc
Gives the information on which files are associated with which program.
chkdsk/f
- To check if there is any error in your disk. If there is any error then it can fix them
chkdsk/r
- To check for physical sector issues. (It might actually reboot or restart, and may take a while).
sfc/scannow
- This command will check your system files. (includes window dll files ) if there is any issue then it will fix them.
DISM/online/cleanup - image/checkhealth
- Used to clean the image of the computer. If you want you can do a quick checkup to see if there is any issue.
DISM/online/cleanup -Image/RestoreHealth
- If the check comes up with some scary issues, then use this to restore or fix it.
tasklist
- To find the process which is running anonymously in your systems
tasklist/findstr script
- To find specific files such as a script.
taskill/f/pid < pid_number>
- Now take that process id and just kill it...
/f
is used to force kill it.
netah firewalls set all profiles state off
- Used to turn off window defender.
netsh firewall set allprofiles state on
- Will turn on windows defender.
ping < url >
- Used to ping
ping-t< url>
- Used to ping endlessly. Can be used for troubleshooting.
traceart
- Used to trace the path to any website until you reach it there
netstat
- It will tell you what you are connected to and what all is connected to you.
netstat - af
- Tells you what ports are all open.
netstat - o
- Tells the PID of all your connections.
Route print
- Displays and updates the network routing table.
- It displays the list of persistent routes is displayed
Route add..... Mask...
- Used to manipulate the network routing table
- Allows us to add a custom route to take.v
shutdown/r/fw/f/t 0
- This command restarts your systems and loads the bios.