3

I'm having trouble understanding how the files work in Ubuntu, especially since it lists differently from Windows' command prompt and PowerShell. For example, when I go to the top most directory and list the files, this is what I get in Ubuntu:

Ubuntu's list of files

I want to go to documents to use Valgrind to compile/debug an EXE file I created, however, this is rather difficult to navigate, considering the Windows counter part is completely different. When I go into "usr" on Ubuntu, it doesn't display the expected filed as "Users" in Windows. How can I do this?

cd /home/$USER/Documents/

returns:

bash: cd: /root/Documents: No such file or directory
abu_bua
  • 10,783
  • 1
    Any reason why you feed the need to use root? Ubuntu is designed to use a sudo account and admin when required. Not permanently ;) Oh and microsoft changed it from how Unix does this, we Linux users still use their method ;-) – Rinzwind Sep 07 '18 at 13:38
  • 1
    I disagree with the close votes :=) – Rinzwind Sep 07 '18 at 13:49
  • Welcome to Ask Ubuntu! Could you please post text files, dialogue messages, and program output listings as text, not as images? To achieve the latter two you can either 1) select, copy & paste the dialogue text or terminal content or 2) save the program output to a file and use that. Longer listings (the editor will tell you what’s too long) should be uploaded to a pastie service and linked to in the question. Thanks. – David Foerster Sep 07 '18 at 14:25

3 Answers3

5

For example, when I go to the top most directory and list the files, this is what I get in Ubuntu:

  • That is the root of the system. Equivalent in Windows: c:

Linux is a multi-user system and is set up as such. Windows used to be a single user system and was/is also set up like that. Main difference: each user has its own place in Linux where files are stored: /home/$USER/ and within that are personal directories. In Windows it is something like c:\Users\%USER%\.

To get to the current users Documents you can use:

cd /home/$USER/Documents/

But there is a shorthand version: ~ points to your home, so

cd ~/Documents 

also works. There are more: $USER for instance will replace with the current user but also $HOME for the home dir or $SHELL for the shell used (echo can be used to show the content: echo $USER will show the current username).

When I go into "usr" on Ubuntu, it doesn't display the expected filed as "Users" in Windows. Help please?

/usr is not what you believe it to be. It now is short for "Unix System Resources" so not related to a user ;) /home/$USER is where you find personal files.

Mind though that since you are using root ~ will point to the home of "root" and that is /root. I would advice to not use root on command line as Ubuntu is made to be used with a sudo account user and limited exposed elevated privileges.

Using a root sessions allows you to delete anything from that system without any restrictions. Using a sudo account would prevent deleting if you accidentally would try to and did not add sudo to the command.

Fabby
  • 34,259
Rinzwind
  • 299,756
  • / is not equivalent to Windows' C:. There may be no C: drive in Windows at all. Moreover, different drives are actually independent. The real equivalent is the UNC path \\?\. E.g. \\?\C:\File is the same as C:\File. – Ruslan Sep 07 '18 at 16:22
  • Note that, apart from the dangers of doing everything as root, running cd ~/Documents as root is not going to put him where he wants to be (presumably he wants to be in his own Documents directory, not root's one). In fact, I don't even think there is a Documents directory under /root. – micheal65536 Sep 07 '18 at 17:09
0

cd to ~. That is your home. You can usually find Documents folder in there

0

I understand that you are not familiar with the Ubuntu Linux file system; in this case I can offer you to install Midnight Commander which was likely known as Norton Commander on Windows. It will help you a lot to work on files in the terminal screen.

Here is what it's like

melic
  • 390