ls is not listing files when sudo -i is used

Asked by Chetan

ls is working as it should be when used but when i use "sudo -i" and ls is not listing any files and
ls- l is giving following message help me......linux is new for me.......i dont know much

tan@tan-desktop:~$ ls
tan dev Examples Pictures Templates
c.lst devc filesystem Public typescript
Desktop Documents Music setup.exe Videos
tan@tan-desktop:~$ sudo -i
root@tan-desktop:~# ls
root@tan-desktop:~# ls
root@tan-desktop:~# ls -l
total 0

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu sudo Edit question
Assignee:
No assignee Edit question
Solved by:
Vojtěch Trefný
Solved:
Last query:
Last reply:

This question was reopened

Revision history for this message
Best Vojtěch Trefný (vojtech.trefny) said :
#1

Because when you use "sudo -i" you're logged as root -- so you're in home directory of root (/root direcotry) and this is empty...

If you wanna change to your home, use command "cd /home/tan"

Revision history for this message
Chetan (chetan.halappa) said :
#2

Thanks Vojtěch Trefný, that solved my question.

Revision history for this message
Chetan (chetan.halappa) said :
#3

thanx..........i am new to linux so if that was stupid thing to ask please excuse me.......

Revision history for this message
Chetan (chetan.halappa) said :
#4

Thanks Vojtěch Trefný, that solved my question.