LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't access my user home directory from terminal (Debian) (http://www.linuxquestions.org/questions/linux-newbie-8/cant-access-my-user-home-directory-from-terminal-debian-4175481707/)

Reprovo 10-22-2013 03:51 AM

Can't access my user home directory from terminal (Debian)
 
Hi.I'm trying to access my home/username/desktop folder from terminal but there Is no directory listed under home#. I was trying to move a .html file from the desktop to var/www and came across this Issue.

druuna 10-22-2013 04:20 AM

You mention /home/<username>/desktop. That should be /home/<username>/Desktop. Linux is case sensitive.

Reprovo 10-22-2013 04:23 AM

Sorry.I mean there's nothing In the home directory. ls or ls-a gives nothing.
If I type cd It gives me /home/<username> :No such file or directory.

brianL 10-22-2013 04:34 AM

Strange. Did you create a user during installation?

druuna 10-22-2013 04:35 AM

Quote:

Originally Posted by Reprovo (Post 5050252)
Sorry.I mean there's nothing In the home directory. ls or ls-a gives nothing.
If I type cd It gives me /home/<username> :No such file or directory.

What exactly are you doing? I can only assume you are logged in as a specific user (say user X) and started a terminal. After starting the terminal you should be standing in the home directory of user X.

Can you post the output of the following commands:
Code:

id -un
ls -ld $HOME
ls -a $HOME


Reprovo 10-22-2013 04:49 AM

@brian , I did create a user yes.

nikolas@Niko:/$
id -un
nikolas

ls -ld $home
drwxr-xr-x 22 root 4096 jun 16 09:41 .

ls -a $HOME
. boot home lost+found opt sbin sys usr
.. dev initrd.img media proc selinux tmp var
bin etc lib mnt root srv .ure vmlinuz

druuna 10-22-2013 05:03 AM

You need to be precise: ls -ld $home should be ls -ld $HOME

How and when did you create this user (nikolas).
How are you logged in ("normal" using GUI, using the CLI or from a remote machine using ssh or ...)?

This doesn't look correct either:
Quote:

ls -a $HOME
. boot home lost+found opt sbin sys usr
.. dev initrd.img media proc selinux tmp var
bin etc lib mnt root srv .ure vmlinuz
It shows the content of the root directory (/) instead of /home/nikolas.

What does the following command show:
Code:

grep nikolas /etc/passwd

Reprovo 10-22-2013 05:38 AM

Sorry typed ls -a $HOME Incorrectly also.I'm logged in via the GUI on a virtual machine.
both ls -a $HOME and ls -ld $HOME give:
ls: cannot access /home/nikolas: No such file or directory

grep nikolas /etc/passwd

nikolas:x:1000:1000:Nikolas Nik,,,:/home/nikolas:/bin/bash

druuna 10-22-2013 05:48 AM

The entry in /etc/passwd looks correct, but....

Its starting to look like you do not have a home directory for nikolas any more, which would explain the output show in your previous post (#6). Some way, somehow the home directory for this user was removed or moved to a different location/name.

mddesai 10-22-2013 05:51 AM

Quote:

Originally Posted by Reprovo (Post 5050240)
Hi.I'm trying to access my home/username/desktop folder from terminal but there Is no directory listed under home#. I was trying to move a .html file from the desktop to var/www and came across this Issue.

what command did you issue to move .html to /var/www. did you check whats in /var/www ?

Reprovo 10-22-2013 05:57 AM

the default index.html is in var/www.
cd /var/www/
mv ~Desktop/webpage.html .

mddesai 10-22-2013 06:28 AM

hmmm, couple of clarifications:

Did you mean 'mv ~/Desktop/webpage.html .' ?

Did you move file as nikolas user or root user. Cause, as nikolas user, you can goto /var/www, but you cannot move file from desktop to /var/www. However, if you move file as root user, then ~/Desktop folder you mentioned is of user root, not of user nikolas.

Anyway, try locate to find out if the /home/nikolas has wandered somewhere else

Code:

# updatedb
# locate -i *nikolas/Desktop*


Reprovo 10-22-2013 07:02 AM

Thanks! I managed to move /nikolas into var/www like the noob that I am.Sorry yes I did mean /Desktop.I'm not sure what I did though.What error did I make In the mv command to cause It to move the home/nikolas folder into var/www?

druuna 10-22-2013 07:37 AM

Quote:

Originally Posted by Reprovo (Post 5050304)
What error did I make In the mv command to cause It to move the home/nikolas folder into var/www?

I can only guess, which I won't do. Have a look at your .bash_history file, it should contain the command you used.

Reprovo 10-22-2013 07:50 AM

Thanks for your time everyone !


All times are GMT -5. The time now is 05:33 AM.