看来我需要使用sudo
我ls
拥有并具有读/写权限的目录。
如果我尝试访问ls
我的媒体驱动器,我可以看到它,但看不到它的子目录,尽管我认为拥有该子目录应该使我能够这样做。当我尝试时,我得到这个结果:
me@icvr1:/home$ ls -al /media/
total 12
drwxrwxrwx 3 root root 4096 Dec 20 11:05 .
drwxr-xr-x 25 root root 4096 Dec 19 12:41 ..
drw-rw-rw-+ 4 me me 4096 Jan 4 12:01 innovationcommons
me@icvr1:/home$ ls -al /media/innovationcommons/
ls: cannot access '/media/innovationcommons/External_Storage': Permission denied
ls: cannot access '/media/innovationcommons/DataStorage': Permission denied
ls: cannot access '/media/innovationcommons/..': Permission denied
ls: cannot access '/media/innovationcommons/.': Permission denied
total 0
d????????? ? ? ? ? ? .
d????????? ? ? ? ? ? ..
d????????? ? ? ? ? ? DataStorage
d????????? ? ? ? ? ? External_Storage
me@icvr1:/home$ ls -al /media/innovationcommons/DataStorage
ls: cannot access '/media/innovationcommons/DataStorage': Permission denied
但是,如果我使用sudo
,我会得到这个更预期和有用的结果:
me@icvr1:/home$ sudo ls -al /media/innovationcommons/
[sudo] password for me:
total 16
drw-rw-rw-+ 4 me me 4096 Jan 4 12:01 .
drwxrwxrwx 3 root root 4096 Dec 20 11:05 ..
drwxrwxrwx 1 me me 4096 Jan 3 13:35 DataStorage
drw-rw-rw- 4 me me 4096 Aug 29 11:33 External_Storage
me@icvr1:/home$ sudo ls -al /media/innovationcommons/DataStorage
total 16
drwxrwxrwx 1 me me 4096 Jan 3 13:35 .
drw-rw-rw-+ 4 me me 4096 Jan 4 12:01 ..
drwxrwxrwx 1 me me 4096 Jan 2 16:08 Images
drwxrwxrwx 1 me me 496 Jan 3 13:37 Places
drwxrwxrwx 1 me me 0 Dec 12 14:53 $RECYCLE.BIN
drwxrwxrwx 1 me me 4096 Dec 12 14:54 System Volume Information
ls -al /media/innovationcommons
为什么如果不使用sudo
,甚至仅使用ls
它的子目录,我就无法成功?