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.
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.
Both...
andCode:cd /home/desktop
are wrong. Linux is case sensitive. It should be:Code:cd /Home/Desktop
Also:Code:cd /home/username/Desktop
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).Code:cd /home/username/Downloads
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 20.04 Desktop Guide - Ubuntu 22.04 Desktop Guide - Forum Guide to BBCode - Using BBCode code tags
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.
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
to see where you are currently in the system.Code:pwd
Once back in home try usingto see the proper directory names.Code:ls
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.
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:
Your home directory has a special symbol as mentioned. So your Desktop could also be named:Code:/home/ishmael/Desktop
Code:~/Desktop
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.
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",
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!Code:cd ~thefu
If you had doneyou would have seen that home is all lower case.Code:ls /
ThenCode: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 usrwould have shown your usernameCode:ls /home
--glennCode:glenn@Psycho:~$ ls /home glenn lost+found ubuntu
Last edited by psychohermit; September 25th, 2021 at 04:55 PM.
Bookmarks