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.
Locating the command prompt
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.
Once you have your command prompt open, you can try your hands on these eight file management commands.
1. Changing Directory
Once you have your command prompt open, it points to a default location, usually your C drive.
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:
2. Create a new file
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:
fsutil file createnew filename1.txt 1000
creates a text file called “filname1” with a size of 1000KB.
3. Get time and date of file creation
To find out the time and date a file was created, use the command
dir /T:C. For example, the command:
dir /T:C filename1.txt
shows the time and date “filname1” was created.
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.
4. Show list of hidden files in a folder
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
5. Hide a file
To hide a file, change the directory to the location of the file and use the command:
attrib +s + h file_name
Files hidden using this command cannot even be seen in File Explorer with the “Show hidden files and folders” option.
6. Unhide a file
To unhide an already hidden file, use the command:
attrib -s -h file_name
7. Rename a file
To rename a file, change the directory to the location of the file and use the command:
rename filename.txt newname.txt
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.
8. Read file content
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.
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.
Our latest tutorials delivered straight to your inbox