Results 1 to 7 of 7

Thread: Trouble nagivating to /home directory in terminal

  1. #1
    Join Date
    Aug 2021
    Beans
    6

    Trouble nagivating to /home directory in terminal

    I used the cd to change my current directory with error. So I inputted the -ls command with the same result. Do I have to elevate to superuser su or need to use a different command?


    I attached a screenshot of my terminal window.
    Attached Images Attached Images

  2. #2
    Join Date
    Jun 2006
    Location
    UK
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: Trouble nagivating to /home directory in terminal

    Both...

    Code:
    cd /home/desktop
    and

    Code:
    cd /Home/Desktop
    are wrong. Linux is case sensitive. It should be:

    Code:
    cd /home/username/Desktop
    Also:

    Code:
    cd /home/username/Downloads
    By the way, please do not post screenshots of the terminal. It is near impossible to read. If you want to post terminal output, simply highlight with the mouse however much you want to include in your post, right-click -> copy, and then paste into your post, not forgetting to enclose the pasted terminal output between BBCode code tags (link in my sig if you need it).

    By the way 2: elevating to superuser in this situation is a bad idea. If you are doing something wrong, elevating to superuser will simply make it easier to do severe damage to your system.
    Last edited by coffeecat; September 23rd, 2021 at 06:02 PM. Reason: corrected careless error!
    Ubuntu 18.04 Desktop Guide - Ubuntu 20.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags - IRC #ubuntuforums

    Member: Not Canonical Team

    If you need help with your forum account, such as SSO login issues, username changes, etc, the correct place to contact an admin is here. Please do not PM me about these matters unless you have been asked to - unsolicited PMs concerning forum accounts will be ignored.

  3. #3
    Join Date
    Apr 2011
    Location
    Mystletainn Kick!
    Beans
    12,396
    Distro
    Ubuntu

    Re: Trouble nagivating to /home directory in terminal

    You were already in home.
    The ~ symbol is symbolic of your home directory.
    You did however move into the /var/log directory.
    To move back to home simply run cd without anything else.
    use the command
    Code:
    pwd
    to see where you are currently in the system.
    Once back in home try using
    Code:
    ls
    to see the proper directory names.
    Common directories like Pictures and Desktop begin with Capitalized letters.
    Most other directories will be all small letters.
    Last edited by deadflowr; September 23rd, 2021 at 06:34 PM.
    Splat Double Splat Triple Splat
    Earn Your Keep
    Don't mind me, I'm only passing through.
    Once in a blue moon, I'm actually helpful
    .

  4. #4
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,109

    Re: Trouble nagivating to /home directory in terminal

    Quote Originally Posted by ishwashere View Post
    I used the cd to change my current directory with error. So I inputted the -ls command with the same result. Do I have to elevate to superuser su or need to use a different command?


    I attached a screenshot of my terminal window.
    To navigate to your home directory, realize that:
    /home is not your home directory. It's actually /home/<username>, meaning it's /home/ishmael for the user in your screenshot.
    Your Desktop would be:
    Code:
    /home/ishmael/Desktop
    Your home directory has a special symbol as mentioned. So your Desktop could also be named:
    Code:
    ~/Desktop

  5. #5
    Join Date
    Nov 2007
    Location
    London, England
    Beans
    7,332
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: Trouble nagivating to /home directory in terminal

    As others have pointed out, the home directory is lower case "/home", not "/Home".
    But that's not your home directory. That's the directory that holds all user's home directories. As your username is ishmael then there will be a /home/ishmael directory, and it is that directory that is your home directory. So your Downloads directory will be /home/ishmael/Downloads.
    To get to your home directory, you can use the '~' symbol, and to get into your Downloads you can do "cd ~/Downloads".
    Last edited by The Cog; September 23rd, 2021 at 05:54 PM.

  6. #6
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Trouble nagivating to /home directory in terminal

    Linux (and all Unix-based OSes) are multi-user. All commands have a userid connected and the HOME for each user is a known thing if there is a login for that user. This is stored in the POSIX passwd entry for each userid.

    After you login, the userid is placed into the HOME for that userid. There are a number of equivalent ways to change directory to the HOME for any userid, but getting to the HOME for the current userid is really easy. Assuming 'bash' as the shell (there are 20-50 different shell commands possible, like command.com or cmd.exe or 4NT.exe on MS-Windows), we can get to the current userid's HOME using any of these commands ... they work from anywhere, regardless of the current working directory - cwd/pwd.

    • cd
    • cd ~
    • cd $HOME


    each of those are equivalent for the current userid.

    To get to a different userid's HOME, just use ~{username}. To if the userid is "thefu",
    Code:
    cd ~thefu
    That would work both for any other user on the system AND for "thefu", just like the 3 commands listed above. This all assumes the directory permissions for ~thefu (or $HOME) allow another userid access. Some users lock access to their HOME directories from other users or to users who aren't in their group. Power to the user!

  7. #7
    Join Date
    Aug 2021
    Beans
    33

    Re: Trouble nagivating to /home directory in terminal

    If you had done
    Code:
     ls /
    you would have seen that home is all lower case.

    Code:
    glenn@Psycho:~$ ls / 
    bin    dev   lib    libx32      mnt   root  snap      sys  var 
    boot   etc   lib32  lost+found  opt   run   srv       tmp 
    cdrom  home  lib64  media       proc  sbin  swapfile  usr
    Then
    Code:
    ls /home
    would have shown your username

    Code:
    glenn@Psycho:~$ ls /home 
    glenn  lost+found  ubuntu
    --glenn
    Last edited by psychohermit; September 25th, 2021 at 04:55 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •