Jump to content

How to open and close directories in the Linux terminal


aum

Recommended Posts

Learn how to use the cd command to change directories with this Linux tutorial.

 

ch01s02.svg_.png?itok=wXS14qIi

Image credits :  CC BY-SA Seth Kenlon

 

To open a directory on a computer with a graphical interface, you double-click on a folder. It opens, and you are now "in" that folder.

 

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.

 

$ pwd
/home/tux

 

$ ls
example.txt
Documents
Downloads
Music
Pictures
Templates
Videos

 

$ cd Documents


$ pwd
/home/tux/Documents


Close a folder


To close a directory on a computer with a graphical interface, you close the window representing that directory.

 

You don't have to close directories in a terminal, but you can always navigate away from a location you've made your current directory. The cd command, issued alone with no arguments, takes you back home.

 

bash$ cd

 

bash$ pwd

/home/tux

 

Source

Link to comment
Share on other sites


  • Views 1.1k
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...