Ubuntu – How to change directory to get into a hidden folder/directory

16.04command linedirectory-structurehidden-files

I have tried the following and I really don't understand the result. Can someone help?

~$ pwd
/home/djj375
~$ ls -ald .docker
drwx------ 2 root root 4096 May 21 14:33 .docker
~$ realpath .docker
/home/djj375/.docker
~$ cd ../../home/djj375
~$ pwd
/home/djj375
~$ cd .docker
bash: cd: .docker: Permission denied
~$ sudo cd .docker
sudo: cd: command not found
~$

Best Answer

Change the permissions with

sudo chmod o+rx .docker

to get access to read and execute (i.e. enter) the directory, this way you can cd into it and display files (provided you have the permissions to do that as well):

$ ls -la .docker
total 12
drwx------ 2 root       root       4096 Mai 26 01:15 .
drwxrwxr-x 3 dessert    dessert    4096 Mai 26 01:15 ..
-rw-r--r-- 1 root       root         10 Mai 26 01:15 file
$ sudo chmod o+rx .docker/
$ cd .docker/
$ cat file
something