Copy, move, edit files: File operations are among the most common everyday tasks. However, those who switch to Windows are confronted with a different structure of the Linux file system structure.
Linux inherited the basic structure and access rights of its file system from Unix. Like Unix, Linux also works with stringent, comparatively simple concepts that follow their own logic. Although the field of Linux distributions is vast, all Linux systems follow a very similar structure, as this is also given by the Linux kernel, which always expects certain files to be in the same location.
Once the initial orientation is successful, there are hardly any deviations in daily work – regardless of which Linux system is used. This is ensured by an agreement between the various Linux software houses, which has been maintained since 1993 as the “Filesystem Hierarchy Standard” under the aegis of the Linux Foundation.
The hierarchy: where is what?
Root directory, referred to as “computer” by many file managers
system-critical folder with the files necessary for booting: kernel, boot manager and ramdisk “initramrd” with driver equipment
/ boot / grub
system-critical folder with the configuration data for the Grub boot manager; Optional changes to the grub.cfg file only for experienced users
system-critical folder with the central executable programs that are necessary for system operation (such as bash, chmod, login, lsblk, mount …); s. a. / sbin and / usr / bin
old mount folder for the content of optical drives, actually obsolete (similar to the now rare / floppy)
System directory for device files: All detected devices are consistently mapped here as files
Central directory for all system-wide configuration files, partly as individual files in the main directory / etc such as sudoers (sudo rights), fstab (drives), mime-types (file types), shadow (accounts and passwords), mostly in extra directories – Prominent examples: “/ etc / apache2” for the configuration of the Apache web server, “/ etc / apt /” with the list of the registered package sources (sources.list and /etc/apt/sources.list.d), “/ etc / samba “with the configuration of the Samba server and the Windows shares (smb.conf),” / etc / ssh “with the configuration of Open SSH as client (ssh_config) and server (sshd_config) / etc / X11 for configurations the graphical user interface
Collective folder for all all user accounts (with the exception of root)
/ home /[user]/
Home directory of a user with typical sub-folders for user data (“Documents”, “Pictures” etc.); / home /[user] is next to the temporary mount folder / media /[user] and / run / user /[Konto-ID] the only directory with all rights for the user including ownership
/ home /[user]/.cache
User-related cache mainly for fonts, image thumbnails and system icons
/ home /[user]/.config
important hidden collection folder for user-specific software settings (desktop settings, language, autostart, web browser, mail, MIME file types, software of all kinds)
/ home /[user]/.local
Further collection folders for desktop user settings that are given priority over general settings, for example own or changed shortcuts (.desktop files) under ../.local/share/applications
/ lost + found
contains file fragments saved with fsck after file system checks (usually only usable by forensic experts)
Mount folder for removable media such as USB or DVD drives is usually used as a mount point when automounting graphical interfaces after connecting media (makes / cdrom and / floppy obsolete). The content is stored under / media /[user]/[Laufwerk] loaded with all rights for the current user.
Optional folder for temporary and static mounting of external data carriers such as USB or DVD drives (is no longer used by automount on today’s systems, see / media)
/ lib, / lib64
system-critical folders with indispensable system libraries (32 and 64 bit). Additional lib folders with system libraries (e.g. / usr / lib, / var / lib) are necessary for application software, but are not system-critical
Optional collection folder for subsequently installed application programs that do not belong to the standard repertoire of a Linux distribution
/ proc, / sys
Collective folders for dynamically queried system and hardware data of all kinds, in particular on CPU, RAM, kernel, data carriers and processes; / proc is a source of information for many system tools, e.g. for CPU or RAM queries (example source files: cpuinfo, meminfo, modules, mounts, partitions, uptime)
Collective folder for temporarily required files during software execution and installations – the only directory to which all system accounts have unrestricted write access
Home directory of the pseudo account root; if root is activated and used, the same subdirectories for user data and configuration data are created as for / home /[user]
dynamic information storage for all programs (tmpfs folder during system runtime)
/ run / user /[user-id]/ gvfs /
Mount folder for automatically mounted network resources under Gnome-like desktops (Gnome, Budgie, Cinnamon, XFCE)
no “User” or “User” folder, but the extensive collection folder for the non-system-related application software (“User System Resources”), ie the programs most used on the desktop
/ usr / bin
contains most of the application software for the graphical user interface (see / bin and / sbin)
/ usr / lib
stores the associated system libraries for non-system-related application software
/ usr / local
Additional software folder: executable programs under / usr / local / bin have priority over the path / usr / bin
/ usr / share / applications
Collective folder for program starters that are displayed in menus or on the desktop
System-critical folder with central executable programs for system administration that only run with root rights (e.g. fdisk, fsck, hdparm, mkfs, parted …); s. a. / bin and / usr / bin
According to the FSH standard (Filesystem Hierarchy) the standard mount folder for data carriers on server systems, whereby some server systems still use / mnt or / media
/ var / log
Collection folder for system logs
/ var / spool
Directory for queues to be processed, primarily print jobs
/ var / www / html
Default folder for Apache or Nginx web services
Virtual folder *
Useful overview of all physical data carriers as well as the currently mounted network shares
Overview of the installed (Gnome) programs
Files that have been earmarked for burning on CD / DVD
Overview of the installed fonts
System settings – equivalent to calling gnome-control-center
Recycle bin – equivalent to clicking on “Recycle bin” in the file manager
The home directory: Users are at home in their own directory under “/ home” and can create, write and delete files and folders as they wish. But only there.
Can you do that? The access rights
The high security standard of Linux systems is often and gladly invoked by professionals and open source fans. Not only ingenious developers play a large part in this, because they are just as rare or fallible in Linux as anywhere else. A large part of the security concept is based on access rights in the file system, which strictly define who is allowed to go where, what can be written and executed. These access rights are always assigned to three groups: The first group is the file owner, the second is the group membership and the third is the rest of the world, i.e. everyone. The root user always has full access to everything.
File and directory rights: In order to correctly interpret the listed authorizations, the names of the owner (here “xenial”) and group (here “users”) are important.
The basic access rights to files and folders are also three in number: read, write and execute. In the case of directories, executing counts as opening, i.e. as permission to look into the folder. When working with files, you have access rights at every turn and you rarely have to change them.
In the shell (command line) there are file permissions with the command
can be viewed in detail, which lists folders and files in a table. The specification is made here for each file system object in the form of compact groups of three, for example, “-rwx – x – x”. A set letter means a granted right, whereas a dash means a denied right. Reading is “r”, writing corresponds to “w” and opening or executing is indicated as “w”. The first group of three concerns the owner of the file, the second all users who are in his group, and the third all other users. An example:
The first character is a dash, which means that the file has nothing special. For a directory there would be a “d” for “directory”. Now the actual access rights follow. The name of the owner of the file is displayed as the first name after the access rights. If it is your own user name, “rwx” means that your own user is allowed to read, write and execute the file. The second row of three indicates the permissions for the group. It says “r-x” here. Every user in the specified group can read and execute it, but is not allowed to write to it.
The last row of three “r-x” means that all other users may read and execute the file, but not change it.
The 10 most important Linux commands for beginners
File manager: indispensable helpers
File manager Dolphin in KDE: With the split window, the KDE program has more to offer than the simpler file managers from Gnome, Unity, Mate and Cinnamon.
Of course, in a Linux system you can navigate through a file system in the shell (command line) and carry out all file operations. Some veteran administrators who have honed their skills on Unix machines will even prefer this route because of its universality. Normal users, on the other hand, do not necessarily need such survival techniques, because capable file managers of the graphical user interface make life a lot easier.
This is Ubuntu’s default file manager. It is a one-window file manager for basic operations like renaming (F2 key), deleting (delete key) and for copying and moving the selected files (Ctrl-C to copy, Ctrl-X to cut, Ctrl-V to Insert).
With the mouse, single or multiple files and folders can be dragged into another window of the file manager, whereby these objects are then moved. A right-click opens the setting or view of the respective rights of folders and files via “Properties -> Access rights”.
are modifications of Nautilus or precursors with a larger range of functions. Caja is the standard file manager in Ubuntu Mate, Nemo worked in Linux Mint. The basic functions are the same as in Nautilus, but there are more extensive setting options.
In terms of functionality, this file manager from KDE is of a different caliber than the rather simple file managers from Ubuntu and Linux Mint. In addition, it is not a one-window affair: the F3 key divides the view into two windows to make it easier to move files from A to B.
The XFCE file manager, as it is preinstalled in Xubuntu, looks simple on the outside, but is based on Nautilus and has network capabilities. There is a connection to Windows networks under “Search network” in order to access shares.
Important tool in the shell: The Midnight Commander is a two-window file manager for the command line, which simplifies file operations in text mode significantly.
File managers are not only available on the graphical desktop, but also in the shell (command line). Not only those users who use a Raspberry Pi without a graphical user interface, but all Linux users should install the Midnight Commander immediately. The program is not pre-installed in Ubuntu and Linux Mint, but can be found in the package sources. The command installs in a terminal
the file manager, the form and function of which is modeled on the Norton Commander. Two windows in the command line, with the Tab key to switch, an integrated editor for text files on F4 and copy (F5) as well as move (F6) make this shell file manager an important tool.
Even better: Under the “Left / Right” menu there are network connections via SSH and Samba (Windows share) to transfer files. No matter what desktop you are on, the Midnight Commander is always a useful addition.