thecoderworld
  • Programming
  • Security
  • Tech
  • Open Source
  • How To
  • Lists
  • Windows 11
  • Chromebook
  • Linux
No Result
View All Result
thecoderworld
  • Programming
  • Security
  • Tech
  • Open Source
  • How To
  • Lists
  • Windows 11
  • Chromebook
  • Linux
No Result
View All Result
thecoderworld
No Result
View All Result

Home > How To > 7 Command Prompt Tricks that You Should Know

7 Command Prompt Tricks that You Should Know

Ajoy Kumar by Ajoy Kumar
April 13, 2021
in How To, Windows 10
Reading Time: 7 mins read
0
Share on FacebookShare on Twitter

In computer science, a Command-line interpreter (CLI) refers to a program that allows users to enter a command, it then reads and interprets the input and executes the input in the operating system. CLI accepts commands from a keyboard in the form of a text line.

Here we will be sharing with you, 7 Command Prompt tricks that you should definitely know in 2021.

RelatedPosts

Best Screen Recorders for Ubuntu

5 Best Screen Recorders for Ubuntu

May 20, 2022
How to Install VLC Media Player on Ubuntu

How to Install VLC Media Player on Ubuntu 22.04 LTS

May 20, 2022

Also Read: What is the Purpose of the Command Interpreter?

Command Prompt Tricks that You Should Know

In this section, we will discuss 7 command prompt tricks that you should know.

1. Listing Files and Directories

If you want to list all your files and directories, you can do it with few command prompt commands.

To view all the files and folders in a particular directory use dir command. This dir command will list all the directories available on your Windows 10 computer.

Listing Files and Directories in Command Prompt

Even you can list all the hidden files and directories if somebody had hidden some files and directories in your computer you can view it with a command prompt. For that use dir /a command

Note: There’s a reason why system files and folders are hidden, so don’t mess with these hidden files and folders this can affect your computer.

2. Opening Files using Command Prompt

Opening Files using Command Prompt

Do you know you can open any files using the command prompt? Yes, you can open any images, audio, and video files using command prompts. 

To view all the files and folders available in a particular directory use dir command.

Now say for example If want to view all the png file available in that directory then I will use

dir *.png

To open a file, use the following command

file_name_with_extension

Also Read: How to Run a Java Program Without IDE?

3. Creating and Removing Directories

Creating and Removing Directories using CMD

Creating and removing directories or folders in a windows 10 computer is very easy using the command prompt. You don’t need to select multiple options for that, just write one Command Prompt command.

To Create Directories, use this command mkdir (make directory)

mkdir New

This command will create a directory called New.

To Remove Directories, use this command rmdir (remove directory)

rmdir New

This command will delete the New directory. Now if you have other directories inside this directory then you have to use

rmdir /s New

This command will delete all the directories which are available inside this directory along with the New directory.

Also Read: How to Shut Down a Windows 10 PC using the Command Prompt?

4. Change Drives and Directories

By default C:\Windows\System32 or C:\Users\<user name> is your default command prompt Directory. Now if you want to work on different drives and directories. For that, you have to use the change directory command.

Before that let us learn how to check the drives available on our computer. For that use this command:

wmic logicaldisk get name

To change drive use the drive name with a colon (E:) this will change the directory to E drive.

To change the directory use this command cd folder_name. For example:

cd desktop

Note: To come back to the default directory or previous directory use this command cd ..

5. Changing Colors of Command Prompt

Changing Colors of Command Prompt

If you want a matrix look in your command prompt then you can change the colors of it. Here we will learn how to change the text color and background color of the command prompt.

To change text and background color, use a color command

color 08

Here 0 is for background and 8 is for text color. Need more help with the color command, use this command “color /?” or “help color“.

Note:- 0-7 are background color and 8,9 and A-F are text color. To come back to normal just use the “color” command.

Also Read: How to Hide/Unhide Files and Folders Using Command Prompt on Windows 10

6. Opening and Deleting Files

Deleting and Appending to Files

Here, we are going to discuss Deleting and Appending to Files. Here we will learn how to open and delete files using the command prompt.

Let’s see how we can open the file:

Use this command to open files with the default software. Say for example your text editor is notepad then when you open the file using the command prompt it will open in notepad.

Here the command:

Navigate to the directory and type the file_name_with_extension (note.txt)

Now to open the note.txt on the command prompt itself then use the command

type note.txt

Now to delet the file usin the following command

del note.txt

7. File Attributes in Command Prompt

If you want to change the file attributes then use the following command.

Note:- If you want some help with the file attribute then use this command “attrib /?“

To hide files use “attrib +h file_name_with_extension“. For example, I want to hide note.txt file then I’ll use

attrib +h note.txt

To add read-only attribute use

attrib +r note.txt

Now to unhide the file use this command

attrib -h note.txt
Previous Post

Types of SQL Injection in Cyber Attack

Next Post

How to Install and Setup PyGame on Windows 10

Ajoy Kumar

Ajoy Kumar

I am an entrepreneur by heart and founder of thecoderworld. Who always follows his passion. I love writing about software, coding, open-source, technology, smartphones, tips, and tricks.

Recommended Posts

Best Screen Recorders for Ubuntu
Linux

5 Best Screen Recorders for Ubuntu

May 20, 2022
How to Install VLC Media Player on Ubuntu
How To

How to Install VLC Media Player on Ubuntu 22.04 LTS

May 20, 2022
What is REST API
Programming

What is REST API?

May 19, 2022
How To

How to Change Screen Resolution on Windows 11

May 19, 2022
How to Change Desktop Wallpaper in Ubuntu
How To

How to Change Desktop Wallpaper in Ubuntu

May 19, 2022
How To

How to Change Screen Resolution in Ubuntu

May 18, 2022

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

  • 1.3k Fans
  • 702 Followers
  • 55 Followers
  • 24.1k Subscribers

Recent Posts

Best Screen Recorders for Ubuntu
Linux

5 Best Screen Recorders for Ubuntu

May 20, 2022
Linux

Top 5 Video Editing Software for Linux in 2021

May 20, 2022
thecoderworld

© 2018 - 2022 thecoderworld

Navigate Site

  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Advertise
  • Career

Follow Us

No Result
View All Result
  • Programming
  • Security
  • Tech
  • Open Source
  • How To
  • Lists
  • Windows 11
  • Chromebook
  • Linux

© 2018 - 2022 thecoderworld