Linux file system program files

What is the Linux equivalent to Windows’ Program Files?

Under Windows, most applications and application data are stored in a special directory known as C:\Program Files (and occasionally C:\Program Files (x86) ). What is the Ubuntu/Linux equivalent to this path? Is there even one?

If you want to know where are the files of specific package, you can use Synaptic package manager. Just search for package, and see its installed files.

I think this question would be improved by a reason for wanting an equivalent. There is a difference between, for instance, «lets see what I have installed and what I can run», and «I’m trying to find the save-game of this/that piece of software, so I can fiddle with it» and maybe even «I suspect some setting-file / ini-file for this program that I can tweak». Those could all be «Program Files» question, but have different answers here.

Related (but probably shouldn’t be considered a duplicate): How to understand the Ubuntu file system layout?

10 Answers 10

Late Answer — I’ve created a roadmap for beginners to follow. If they are looking for a file but don’t know where to look, they can use the map to roughly navigate around. You can download a hi-res PNG here. You can find the related post here.

When I see it laid out like this, I realise it’s no wonder modern distros try to hide this stuff. What a mess (beautiful mess). And I don’t agree with this layout completely — it’s brilliant, but for example /etc holds application configs as much as O/S configs, so it feels like it should be to the left of the second-from-right-most yellow «User Specific» question as a «no» branch. For example, apache is an application, it’s not O/S essential. Neither is Docker, Folding@Home, VMware, or a host of others that use /etc for configs. Great diagram though.

[EDIT: You should probably check out d4nyll’s answer instead, which is a nifty map, acting as an extensive beginner’s guide to the Linux file system]

/bin and /usr/bin is where the scripts are that start the programs. The direct equivalent of «Program Files» though is probably /opt or maybe /usr/share (see Filesystem Hierarchy Standard). That directory contains the various support files for most programs.

Nautilus showing /usr/share

There probably isn’t a direct equivalent however, since, for example, library files are shared across the system (in /lib ) and options are either user specified (in the user’s home directory) or universally located in /etc .

So installing a program via a deb file, repository or build will likely place files in all of these locations.

[EDIT] And as others note, there is also /sbin and /usr/sbin . Plus /usr/local/bin , /opt/bin and even /usr/games/ . So definitely not a direct comparison to c:\program files !

How about /opt ? I’ve seen that hold many (usually closed-source or app-based) programs before in a similar way to Program Files .

Читайте также:  Современный 32 битный linux

Seems to be going that way, with the advent of the Ubuntu Software Centre delivering its games there, certainly. But even then, hardly a direct comparison, really, is it? Might the closest thing these days though.

/usr/local/bin is a semi-common location for software that might be not commonly used by a user/company.

If you’re looking for productivity in the workplace, (1) Everything is terminal. Terminal is much faster than navigating through a hierarchy of options in a program. You usually have to google how to change a setting anyway which involves following a sequence of screenshots, now google gives you a copy-pastable command (2) cron’s let you setup anything to run in the background and do whatever you want it to do (3) It’s easy to use bash to automate anything you want to be automated

EDIT: See also d4nyll’s answer below above for an excellent and beginner-friendly map!

Read my answer below for more info on what the PATH environment variable is, what .desktop files are, and how to find a specific program using various linux commands.

Original answer:

There is no easy answer.

/bin , /usr/bin , and /usr/share

As mentioned in the other answers, you can find most executables under /bin or /usr/bin , and the support files are installed in /usr/share .

/usr/local and /opt

There are however more directories in which Ubuntu installs applications. The PATH variable, which determines where to search for an entered command, might give you a clue, mine looks like ( echo $PATH in a terminal):

/usr/local/cuda/bin:/usr/local/texlive/2012/bin/x86_64-linux:/usr/games:/home/gerhard/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games 

As you can see some software is installed in /usr/local and have their own directory and bin . Another place where many programs are installed is /opt . The properties of these locations are explained by the Filesystem Hierarchy Standard, which is a very good read. Unfortunately, the difference between /opt and /usr/local is not very well explained, someone on the unix stackexchange had a more elaborate explanation:

  • /usr/local is a place to install files built by the administrator, usually by using the make command. The idea is to avoid clashes with files that are part of the operating systems that would either be overwritten or overwrite the local ones otherwise. eg. /usr/bin/foo is part of the OS while /usr/local/bin/foo is a local alternative,
  • /opt is a directory to install unbundled packages each in their own subdirectory. They are already built whole packages provided by an independent third party software distributor. For example someapp would be installed in /opt/someapp , one of its command would be in /opt/someapp/bin/foo [and then usually a symbolic link is made in one of the bin directories in the PATH , or the program is called from a desktop file (see below)].

Finding a specific program or command

.desktop files

To find out where a specific program is installed, you can do a number of steps. First you need to locate its .desktop file. Desktop files are simular to shortcuts in Windows, and for system applications they are located in /usr/share/applications . The desktop files for applications that are only available for the current user are in ~/.local/share/applications . Take for example Google Chrome, which has the desktop file /usr/share/applications/google-chrome.desktop and look for the line that starts with Exec= , this determines how to start Google Chrome. It says:

Exec=/opt/google/chrome/google-chrome 

So you know Google Chrome is in /opt .

Читайте также:  Pdf for linux commands

Now for Mozilla Firefox which is located in /usr/share/applications/firefox.desktop . It simply says

At first this doesn’t seem to help that much, but then you realize that firefox must be in a directory that is in the PATH variable (most likely a bin ), and we can look it up (see below).

Looking up commands

To look up commands you can use one or more of the following: type , which and whereis (I’ve included a link to their manual pages online).

  • type: it describes a command, and indicates how it would be interpreted if used as a command name. Possible types for a command are:
    1. alias (shell alias)
    2. function (shell function)
    3. builtin (shell builtin)
    4. file (disk file)
    5. keyword (shell reserved word)

(type itself is a shell builtin, try it with type type :P)

Executing type firefox gives us

which is what we wanted to know

If a command is a file (which you checked with type ) you can then also use:

    which: shows the full path of the command, Executing which firefox gives us

firefox: /usr/bin/firefox /etc/firefox /usr/lib/firefox /usr/lib64/firefox /usr/bin/X11/firefox /usr/share/man/man1/firefox.1.gz 

You can inspect /usr/bin/firefox closer with ls -l /usr/bin/firefox and this gives:

/usr/bin/firefox -> ../lib/firefox/firefox.sh* 

It appears that /usr/bin/firefox is ‘only’ a symbolic link to the script /usr/lib/firefox/firefox.sh . If you inspect the script you discover that the script calls /usr/lib/firefox/firefox .
You may rest in peace now 🙂

Источник

Where is “Program files” folder in Linux?

Users coming from Windows to Linux often wonder how they can launch a program in case it doesn’t show up in the programs menu selection. If you’re one of those users, then you might want to stick around, for here you will learn how to navigate your way inside the Linux file system. Understanding the Basics

windows 8 program files

Understanding the Basics

Linux and Windows are two separate kind of operating systems, they both differ from each other not only by the way each look and feels but also by the way they organize their file structure, i.e. one system uses single folders to contain mostly all of the components of an installed program while the other, on the other hand is using general folders to contain specific kind of file types.

To clarify on what the above paragraph is basically saying, here is a simplistic sketch I made depicting the differences between Windows and Linux file structure:

linux vs windows file structure

As you can see by the image above, while Windows is ordered in a manner where each program has its own directory, primarily inside the Program files, Linux on the other hand is organizing the programs in a way that they dispatch their diverse kind of file types among designated directories prepared in advance.

The principle behind the Linux file system is that if the referred program belongs to the user, i.e. for user needs as opposed to system needs then it should be found inside the usr directory, if you are looking for the executable (.exe) file type, then you should look inside /usr/bin, for bin is where most of the executable files go to.

This all might look a little bit complicated for someone who had just made his first steps upon Linux systems, maybe it’s because you are new to Linux and already used to Windows, then again, maybe not. But remember, this “complexity” is what gives Linux the ability to be so modular and flexible in contrast to other OSs out there.

Launching program from file browser

So now that you are aware of the basic principles behind the way different programs are scattering their files amongst your Linux OS, here is an example of how you can launch Firefox straight from the file browser: navigate to File System by clicking on it in the left sidebar > then enter usr > bin > Firefox.

Источник

Куда Linux ставит программы. Коротко о файловой системе Linux.

Файловая система Linux очень сильно отличается от того, к чему привык пользователь Windows. Тут нет привычных дисков с их буквенным обозначением и нет папки Program Files.

Файловая система Линукс располагает папки по типу дерева, которое идет от некого корня.

И главное, любая папка может физически находится на другом диске, как логическом, так и физическом.

Скажем папку Home ставят на другой диск, папка хранит все документы пользователя и в случае переустановки системы, они так и останутся.

Надо быть справедливым, такая возможность есть и у Виндоувс, и правильно так поступать(расскажу, если кто не знает), да и всякие свои файлы и программы обычно люди ставят на другой, не системный диск.

И так, мы отвлеклись. Каждая папка Linux хранит свой тип файлов:

/etc — здесь хранятся файлы разных конфигураций, настройки системы, скажем файл fstab хранит информация ваших файловых системах, в нем задаеться информация как их монтировать и что с ними делать. В былые времена я руками туда вписывал разделы виндусевских дисков, сейчас, благо, все монтируется автоматически.

/dev это папка файлов устройств, да в Линуксе каждое устройство это файл.

/media сюда монтируются съемные носители

Но это все тема отдельная, нас интересует именно куда программы то ставятся.

/usr вот в эту папку идут все программы пользователя. Там содержаться и исполняемые файлы, и библиотеки и прочее.

Когда вы скачиваете установочный пакет, то он представляет из себя архив с файлами программы и файл, который указывает установщику, куда положить эти файлы. Существует четкое распределение файлов по папкам, но последнее время, это не всегда так.

/usr/bin — сюда помещаются исполняемые файлы программ

usr/lib — а здесь библиотеки, которые нужны программе

usr/sbin — сюда помещаются исполняемые файлы от имени администратора

/usr/share — прочие файлы программ

Как я писал выше, что существует правило распределения файлов, но оно не всегда соблюдается.

/opt ряд программ устанавливается в эту папку, там создаеться папка программы, в которой все ее файлы, по типу, как это происходит в виндоувс. Изначально это папка для установки проприетарных программ.

Но некоторые программы «идут еще дальше и , как сказать, ставят себя в папку /home/имя_пользователя/opt

Узнать, куда разместились файлы программы можно командой:

А через пакетный менеджер можно получить более подробную информацию, включая все графические файлы и тд

Источник

Оцените статью
Adblock
detector