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:
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
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 likec:\Users\%USER%\
.To get to the current users Documents you can use:
But there is a shorthand version:
~
points to your home, soalso 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)./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.cd
to~
. That is your home. You can usually findDocuments
folder in thereI 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.