8 Useful Commands to Manage Your Files in Command Prompt

command-prompts-file

The black screen of the command prompt is far too dull to be the first choice for management of computer resources for most people. I personally prefer a nice graphical user interface that has all the options I need for managing my files. That said, why would anyone prefer doing file management with the command prompt?

One obvious reason could be because one is a geek, and it seems geeks sometimes like the hard way around computing. Another reason could be because understanding the command prompt liberates one and makes one stand out as a more accomplished computer user. Whatever your reasons may be, these are some basic file management commands you can carry out using the command prompt in Windows 10.

The fastest way to open your command prompt is by pressing Win + R. This brings up a tiny popup at the bottom-left corner of your screen. In the text box type cmd and click OK.

cmd-file1

Once you have your command prompt open, you can try your hands on these eight file management commands.

Once you have your command prompt open, it points to a default location, usually your C drive.

cmd1

Type cd followed by a space, then type the directory path you want to change to. For example, to change the directory from the default as shown above to the directory “C:\Users\Afam\Downloads,” I will type in the command prompt:

cmd-file2

To create a new file, the fsutil command is used. The following steps are important.

  • The directory should be changed to the desired location.
  • The name and extension of the file should be declared.
  • The size of the newly created file should be declared.

For example, the command:

creates a text file called “filname1” with a size of 1000KB.

cmd-file3

To find out the time and date a file was created, use the command dir /T:C. For example, the command:

shows the time and date “filname1” was created.

cmd-file4

Do note that it is important to include the extension of the file while using this command, which means dir /T:C filename1.txt is not the same as dir /T:C filename1.

To show the list of all the hidden files in a folder, follow these steps:

1. Navigate to the desired directory using the cd command as shown in example 1.

2. Type the command dir /A:H /B

cmd-file5

To hide a file, change the directory to the location of the file and use the command:

Files hidden using this command cannot even be seen in File Explorer with the “Show hidden files and folders” option.

To unhide an already hidden file, use the command:

To rename a file, change the directory to the location of the file and use the command:

This command accepts the current name of the desired file and the new name. While using this command, it is important to show the extension of the file. In this case “.txt.”

Do note that a hidden file cannot be renamed.

This command basically makes you read the content of your file right on your command prompt. The steps are:

1. Navigate to the location of the desired file.

2. Type the command more filename.txt. “Filename should be the name of the file you want to read.

cmd-file6

These are rudimentary file management commands you can perform using the command prompt. It is in no way an exhaustive list, but they will provide a good starting point in your understanding of using the command prompt.

Leave a Comment

Yeah! You've decided to leave a comment. That's fantastic! Check out our comment policy here. Let's have a personal and meaningful conversation.

Sponsored Stories