Learn how to open a directory in terminal Linux and how to open a file in a directory in Linux terminal. Here is how to open file from terminal Ubuntu or open folder from terminal Ubuntu.
open folder from terminal ubuntu
Using cd command. The cd or change directory command allows you to change your directory, or in other words, open a new folder. When you open the Terminal, you are in your home directory. The following command will help you in opening the folder of your choice:
cd /path/to/file
To open a directory in a terminal, you use the cd command to change your current directory. This essentially opens that folder and places you in it. Note that using cd command alone with no arguments, takes you back home (it takes you out from the folder).
It must be known to all that the tilde symbol (~) represents our home directory. You can use this symbol in the cd command to move to a folder in your /home/[user]/ directory. Also, the pwd command stands for print working directory. If you want to know the exact directory path where you are currently. Simply run the pwd command to do so.
Using cd Command
The / symbol with the cd command helps you in directly opening the root folder.
The ‘..’ symbol with the cd command helps you in navigating up one directory level:
The ‘-’ symbol with the cd command takes you in back to the previous folder you were in.