Questions on Linux file system (coming from Windows)

Hi semi linux newbie here,
I want to try using Ubuntu 18 as my main OS and was wondering how the file system structure works. Specifically:

  1. Is there a folder similar to AppData that stores savedata/configs
  2. Where would I find internal drives? Do they mount automatically?
    2.5 Is there a way to stop specific drives from automounting? Going to dualboot windows and I don’t want it to try reading the windows partitions
  3. Where do programs install to when using apt-get?
  4. Is there a %TEMP% folder that needs to be cleaned out every so often?
  5. Is there a way to move Documents, Videos, etc. to another internal drive? Would I use symlink? How would the permissions work for that?

Sorry if these are all really obvious answers. I’ve messed a little with ubuntu servers but not enough to answer all these questions.

1.yes system config files are located in /etc some configs are saved in your home folder in hidden folders as well but it’s all mostly in /etc
2. your windows partitions should not automount but they will be visible in your file manager as an option to be mounted.
3. /bin or /usr/bin typically.
4. there is /tmp but you don’t need to manually clean it
5. you can map your /home folder to a seperate partition you can set this up during installation

1 Like
  1. This stuff is under your home directory, typically under /home/youruser/.config for user-specific and /etc for global.
  2. Drives mount under /media and removable drives do automount by default. You can blacklist individual devices but this is pretty complicated to do, messing with udev.
  3. Various spots, typically /bin or /usr/bin. You basically don’t need to worry about it.
  4. There is /tmp, and it autocleans when you reboot
  5. Sure, ln -s /home/Videos /media/otherdrive/Videos. Permissions would transfer.
1 Like

Perhaps this could be of help:

/etc/ is your root config location, most of the time you don’t want to mess with it
your /home/ directory is your users main directory
you have ‘dot files’ files that start with .
These files are hidden and generally have config info for each program.
To see hidden files in your UI you can use CTRL+H

Before messing around a bunch with these, it’s probably good to set up a second user.
I’d try any changes on the crap user account first (DONT DO ROOT CHANGES) and just see what it does. If you like the changes, add them to your main account.

1 Like
  1. Most configs etc. is stored as .folders in your /home/username folder.
  2. they dont mount automatically but usually in the gui there is the ability to just click the icon and they auto mount, it kind of depends on your desktop environment, unless you stated you want them to mount during the installation offcourse, else you can add just them yourself to /etc/fstab easily, and they’d mount during boot.
  3. the binaries are usually located in /usr/bin or /usr/local/bin. They’re kind of global folder, feks, if you have a helloworld.sh script in /usr/bin, you can from your home folder just type hell(tap) and it’d auto complete, libraries and other stuff is located else where on the file system, ranging from driver files etc. it’s much a hierachy like windows, just new folders.
  4. /tmp, it is a ram drive’ish so flushes on reboot/shutdown
  5. any drive you can write to you can move your files to, its not really hardware dependant, just a matter of filesystem, and user rights. in that sense it works much like windows, except there is a better sanity check before random_program_01 says it is admin, since you’d have to execute it as root with password and all instead of clicking yes in a gui.
1 Like

Where do programs install to when using apt-get?

@Ruffalo mentioned that you generally don’t need to mess with this, but I’ll expand on another Linux concept that will explain why.

In Unix-like systems, there’s a variable ($PATH) that tells your shell where to look for executables. By default, this includes /usr/bin, /bin, and a few other places. Because of this, you’ll almost never need to know the full path. Simply typing in the name of the executable will run it.

$PATH is a per-user setting. The root user generally has a few additional locations set in $PATH, like /usr/sbin. As a general rule of thumb (but not a hard rule), if something that you know is installed doesn’t autocomplete on your shell, it likely needs elevated permissions to run.

In GUI-land, .desktop files do things like populating menus, so you won’t need to bother will full paths for those, either.

Thanks for all the help everyone! I’ll be installing Ubuntu this weekend. If I have any other questions I’ll definitely ask :smiley:

1 Like

I would suggest you try Ubuntu Mate edition, it is specifically set up to be easier for windows users to get into. I just had my roommate install this over the Gnome version for some users at his job and they like it a bit better as it feels more familiar.

1 Like

Under Ubuntu there is a disks app that is similar to Windows disk management. You can look and all the drives in your rig and see if there mounted and where.

1 Like

join the user forum for your distro, there you can get in depth help on a lot of things (tweaking your system, setting up dvd playback, and so on)
many of us linux users work with our own choice of distro and it may not be the same as the one you choose, but is usually close enough we can answer most questions.

2 Likes

Definitely, the Ubuntu forums are very friendly and helpful to newbies.

3 Likes

Also - slightly off topic - dont type apt-get

apt was updated so that just styping apt performs the same function as apt-get in addition to updating: so for example

apt-get install steam

would only need

apt install steam

and apt-get update && apt-get upgrade

would only need

apt update && apt upgrade

adding a repo also updates so

add-apt-repository graphics-drivers/ppa
apt-get update
apt-get install drivers

only needs
add-apt-repository graphics-drivers/ppa
apt install install drivers

1 Like

TIL.

1 Like

Linux is a multi-user system designed to allow multiple users to coexist on a single system. Hence, the use of user directories within /home.

Configuration files in /etc affect all users on the system. Configuration files in a user’s /home directory affect only that user. Users should generally avoid modifying files in /etc if only because their changes may be overwritten by an update. Configuration files in the user’s /home directory will override counterparts in /etc.

No direct equivalent of the Windows convention of letter-naming each drive exists in Linux. Drives are mapped to partitions. I.e., every Linux system must have a directory called “/”. This is the top of the filesystem’s directory tree. “/” is often mapped to a partition that encompasses on entire drive. (This is typically the default “auto” partitioning setup used by distributions when the installer detects the system uses a single physical drive.) But, “/” does not need to be mapped to a partition that encompasses an entire drive. A partition can be created that uses a portion of a drive and “/” can be mapped to it. And similarly for any other directory.

All but the simplest programs consists of multiple files. Executable components are typically placed in /bin or /usr/bin. The rough distinction: /bin traditionally contains system executables and /usr/bin contains applications.

1 Like

Yup I already do this! Saves so much time when updating programs on the server I use.

1 Like