Linux Directories Explanation Part- 2

/run

This is differently and distros use it in slightly different way. It’s a tempFS file system which means it runs in RAM. In other words, everything is gone when system is rebooted or shut down, it’s used for processes that start early in the boot procedure to store runtime information that they use to function.

/snap

This is a folder where snap packages are stored and are mainly used by ubuntu. Snap packages are completely self-contained application that run differently than regular packages and applications.

/srv

This is the service directory where service data is stored. It’ll probably be empty for you but if you run a server such as web server or FTP server you would store the files that will be accessed by the external users here. This allows for better security since it’s at the root of the drive and it also allows you to easily mount this folder from another hard drive.

/sys

The system folder has been around a long time. It’s way to interact with the kernel- one older example is writing to a file using VGA switcheroo and change settings on graphic card in a hybrid system. This directory is similar to the run directory and it’s not physically written to the disk. It’s created every time the system boots up so you wouldn’t store anything here nothing gets installed here.

/tmp

TMP is of course a temp or temporary directory this is where files are temporarily stored by applications that could be used during a session. E.G.: if you are writing a document in a word processor, it will regularly save a temporary copy of what you are writing here. So that if the application crashes it can look here to see if there’s a recent saved copy that you can recover. This folder usually emptied when you reboot the system on occasion you might find some files or directory that remain and could be stuck there because the system can’t delete them. This normally isn’t a big deal unless there’s hundreds of files or the files taking a lot of disk space. In which case you might want to log in as the root user in single user mode, navigate this folder and manually delete them.

/usr

This is the user applications where application will be installed that are use by the user opposed to the bin director. These directories are used by the system and system administrator to perform maintenance. It’s also known as the UNIX System Resources. Any application installed here are considered non-essential for basic system operation. Installed application will reside in one of several places here such as user bin, user sbin or local bin.

/var

It is the variable directory. It contains files and directories that are expected to grow in size. You find things in here like databases for mail and temporary storage for printer queues also known as the spool.

/home

When you enter the home folder you’ll see that each user has its own folder inside of it. The home folder is where you store your personal documents like I said each user has their own folder and each user can only access their own unless they use admin permissions. Some users mount the home folder on a different drive or different partition which allows you to reinstall your system and preserve your files. The home folder also contains many directories which store your application settings. A hidden directory is simply one that starts with a period. Linux hides these by default you can view them in the file manager by selecting show how hidden files or by pressing ctrl+H. This is of course using nautilus in gnome and some file managers might be different.

You can see if Linux is kind of similar to Mac but very different from windows. Although it seems like a mess, it’s actually a more efficient way of doing things and allows much more sharing of common resources between packages. When it comes to adding and removing software, your distros will have a package manager, that will handle this for you. Package manager tracks where everything is going. So that when you remove your packages it takes all those files with it.

I hope you found this informative.