Skip to main content

Command Palette

Search for a command to run...

5 CMD Tricks You Should Know!

Updated
2 min read
5 CMD Tricks You Should Know!
E

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.extension or copy con file_name.extension command which will allow you to input the required information in your file. To save and exit, press Ctrl + 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_ext or more file_with_ext. Both can be useful in their own ways

  • For 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 directory
  • cd dirname - For changing directory
  • rmdir 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 immediately
  • shutdown -a - Abort Shutdown
  • shutdown -r - Restarts system
  • shutdown -l - Log off current user
  • shutdown -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 ;)

parrot

Thanks For Reading

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