Technoloxy

Daily Source of Tech

Tutorials

cmd: How to navigate, view, & run files/folder?

Terminal

Terminal

 

You might have recently discovered cmd and are looking to learn more about cmd’s commands like, “How to navigate to folder?”, “How to view folders inside folders?”, “Which command to use to run files?”. You have come to the right place!

Command prompt, also known as cmd, is the command line interpreter app which is available in default on Windows OS. We can execute certain codes/commands in this application to do certain tasks. This can be interpreted as a command based file explorer or file explorer to be cmd based GUI. 

 Let’s get right on to the point!

Changing Folders: cd command

The “cd” command is used to display which directory(folder) you are currently in or change your current directory to a new one.

Commands:

  • Display current directory: "cd"
  • Go to directory(folder): "cd foldername"
  • Go back to parent directory: "cd .."
  • Go to folder inside folder: "cd parentfolder/childfolder"
  • Go back twice: "cd ../.."

cd command

This should solve your “cmd How to navigate to folder?” question but don’t you want to view what’s inside the folder? Look no further!

Viewing Folder Details: dir command

The “dir” command is used to display the details in a directory. It shows sub-folders and files inside a folder.

Commands:

  • Display folder details: "dir"

dir command

  • Display files/folders names starting with certain letter(s): "dir letter*"
  • Display files/folders names ending with certain letter(s): "dir *letter"
  • Display files/folders names containing certain letter(s): "dir *letter*"

Letters search

  • View hidden files/folders: "dir /AH"
  • View read-only files/folders: "dir /AR"
  • View folders only: "dir /AD"

Attributes command

Open/Run file

To open or run files from cmd itself, you simply need to write the filename and its file type.

Commands:

  • View text file: "filename.txt"
  • View image file: "filename.png"

Run file

Viewing command features

This is one of the most important command in cmd which displays the information about command like what it does, what features it has and how it works.

Commands:

  • View “dir” information: "dir /?"
  • View “cd” information: "cd /?"

Test them out with any commands and learn more!

Conclusion

Command Prompt has many functionalities. We just hit the tip of the iceberg  by covering the very basics of how we could navigate, view and run files/folders. Check out our other tutorials on cmd below! 

 

Having trouble converting your java file to exe from cmd? We have it covered!

View the official documentation for command prompt!