5 CMD Tricks You Should Know!

Hey there, I'm Eklavya - a full-stack web developer who's passionate about crafting beautiful, intuitive web experiences. With a specialization in NextJS, ReactJS, NodeJS, and Tailwindcss, I'm well-versed in creating cutting-edge websites and web applications that not only look great but also perform flawlessly. In addition to my web development expertise, I'm experienced in developing REST APIs with PostgreSQL and MongoDB. Plus, I have a knack for GUI and mobile development, making me a versatile and well-rounded developer.
In this post, we will discuss 5 CMD tips and tricks that will improve your productivity as a Windows User
List out items in the directory
Using dir command, you can list all the items available in your directory along with its date and time when it was created and file size in bytes
If you only want to list files/folders names, use dir /b
And dir /s to recursively list all the files inside the present working directory as well as subfolders
Create/View/Delete File/Folder
- For creating a file using CMD, use
type con>file_name.extensionorcopy con file_name.extensioncommand which will allow you to input the required information in your file. To save and exit, pressCtrl + C.
But still, these commands have some of the drawbacks, like your indentation would be disturbed if pasted (from outside content), and also you will not be able to view any existing data filled in that file. You can only overwrite or create a completely new file using one of these commands.
For viewing a file, use
type file_with_extormore file_with_ext. Both can be useful in their own waysFor deleting a file, use
del file_with_ext. You can delete multiple files using this command.
You can use the following commands for folders
mkdir dirname- For creating directorycd dirname- For changing directoryrmdir dirname- For deleting directory
Shutdown system
Everyone knows how to shutdown Windows using its Interface, but how to do it using CLI?
shutdown -s- Shut down PC immediatelyshutdown -a- Abort Shutdownshutdown -r- Restarts systemshutdown -l- Log off current usershutdown -f- Force shutdown eventually and the user doesn't get any warnings!
IP Address
Do you know your IP Address?
Ipconfig command is used to find the IP address of a system from CLI. Run the command ipconfig to print IP addresses for all network adapters installed on the system.
Parrot Animation
What if a dancing parrot suddenly appears in your cmd?
Try curl parrot.live. No additional software installation needed!
You can use this command to impress your friends ;)

Thanks For Reading
Thanks for reading this blog post, if you want to talk more with me in general, you can message me here

