Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

how to access to a hidden folder?

Writer Matthew Barrera

I want to know how to access to a hidden folder using Terminal.

I am nos asking how to make it visible.

I have the folder home/.virtualenvs

In Terminal I tried:

$ cd virtualenvs and $ cd .virtualenvs

and I got:

bash: cd: virtualenvs: No such file or directory

How to acces from Terminal then?

thank you

1

1 Answer

Before we start lets locate the folder:

  1. realpath virtualenvs
  2. realpath .virtualenvs

Now assuming you get a return of /home/.virtualenv from option 2(again assuming it was actually a hidden folder), then we need to move it to the proper place which aught to be in /home/$USERNAME or /home/daniel in your case.

We do so by typing this in the terminal:

mv /home/.virtualenvs /home/daniel/

But if it returns /home/virtualenvs, then the folder isn't hidden and should be moved thus:

mv /home/virtualenvs /home/daniel/

NOTE: If not hidden run through the answer without the . before every occurrence.

Now you access hidden folders from the terminal like any other, except you have to add the . character before the name. Now in your case the fault is that you did not add the exact location of the virtualenvs folder.

Say the virtualenvs folder is in our /home directory ( as we had moved it there ) then to get at it from the terminal we will put it this way:

cd /home/$USERNAME/.virtualenvs

Now note two things here:

  1. We used the absolute path to get to it

  2. We inserted the _environmental variable %USERNAME into the path. We could easily have inserted or used daniel if that is the name Ubuntu knows you by. In which case we would have had it like this:

    cd /home/daniel/.virtualenvs

Now to see where your virtualenvs folder is run:

realpath .virtualenvs

This will return the path location of that folder which you will then use with the cd command to enter into it.

Absolute and Relative Paths:

Now let me try to explain this so you won't need to always type /home/daniel/.virtualenvs to get into .virtualenvs folder.

  1. Relative Paths:

    • If I typed pwd and the result was /home/daniel. That means I am sitting or located in /home/daniel and when I type realpath .virtualenvs then also get the result /home/daniel/.virtualenvs then to get into virtualenvs ( which if you also is in /home/daniel) I will type:

      cd .virtualenvs
    • Now this is the relative path, i.e. in relation to where I currently am.

  2. Absolute Paths:

    • If I don't know where I am, but know that the .virtualenvs folder is in the /home/daniel as seen when we use realpath .virtualenvs command. Then I will use the absolute path to get to it with:

      cd /home/daniel/.virtualenvs
    • Or if I type pwd to know where I was in the filesystem and I get a result like: /usr/lib then to get to .virtualenvsthe absolute path will be need as the relative path won't get me there. So from location/usr/lib` I would type:

      cd /home/daniel/.virtualenvs

Now another important note is the use of ~/ in place of /home/daniel. This can be used to avoid typing the full /home/daniel, so for the absolute path to .virtualenvs I would have typed:

cd ~/.virtualenvs

and this would have got me there.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy