Where is the apps folder?

Archives Forums/Linux Discussion/Where is the apps folder?

William Drescher(Posted 2007) [#1]
I"m new to linux and I have Ubuntu 6.06 and I can't find where my applications folder is. Can anyone tell me?


Picklesworth(Posted 2007) [#2]
http://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

It's kind of scary at first. You'll get used to it eventually :P

I am figuring it out not by studying that page, but by just using the thing and toying with different programs on my computer. It eventually becomes natural where everything is, and it starts to make a lot more sense than having a single "applications folder", but it definitely takes a lot of unlearning.

Linux distributions (particularly Debian-based ones) can get away with this madness thanks to Packages, which boil down to a centralized system that keeps track of every piece of data installed on the system. A debian package is often mistaken as an installer, but it really is not; it's just a really cleverly made archive that can be used by an installer program (usually that comes with the distribution, such as dpkg with Ubuntu) to put all those files that make up a program in the right places. The package, as well as having all of its contents, has a description, a name, and many other handy variables for package management.

Any package management solution that supports that kind of package can install it, and when this happens it gets added to a database. That entry in the database reflects the package's installed files and other handy information. In this way, the package (and thus its installed files) is removed not by deleting from the applications folder (since there isn't one!), but by uninstalling the package via a utility like aptitude. Even though its contents are spanned all over the file hierarchy (possibly even on different partitions, hard drives or network locations!), they are all cleared out with a single simple operation.

Oh, and this is completely worth it, by the way. Since all these files can be tied to single packages, neat things happen. For example, one day my file system ended up with a bit of corruption that was detected by fschk. While another system would have just told me "You're disk is corrupted! Haha! Too bad!", this went a lot further. When I next ran Aptitude, it saw that an area of the file system had been reported as damaged and pointed out to me that it was in the realm of a package I'd installed. It offered to reinstall the files, and all was well :)

Having said all that, you won't need to know a whole lot of these for most uses. /usr tends to have everything one needs if it's the type of app that isn't expecting to be given extra tweaking by administrators. (For example, web servers, ssh and samba put lots of stuff in /var).
Keep in mind that per-user settings should always be put in the user's home folder. Unfortunately, there is no standard structure in the home folder, so app data just goes in there amongst all the user's things. Give it a name starting with a dot (eg: .myapp) and you will be fine. Fail to do this, though, and... you will regret it in penguin Hell.

Another thing that sort of fits in with the central applications folder idea is the .desktop entry standard. Unfortunately, there is more than one place that these go, but the idea is quite simple: A file contains a bunch of keys and values that describe an application. This has methods to run the program, a description, a name, MIME types, and other such fun details. These .desktop files are, in certain cases, used to generate the main menu. They are also used for panel applets, screensaver themes, "special" directories... all sorts of magic!
Thanks to these, you can theoretically put your main executable anywhere and have the .desktop files point to that. In a few cases, even, that makes sense!


Winni(Posted 2007) [#3]
There is no applications folder per se in Linux. Open a shell and type "which <appname>", it'll show you where a specific program (that is in the path) is.

For example, on my machine here

which python

returns

/usr/bin/python

So /usr/bin is the applications directory --- in -this- case.


D4NM4N(Posted 2007) [#4]
It depends, i guess the equivalent of windows is (usually)

-"/usr/bin/..." for executables (like program files & executable scripts)
-"/usr/lib/..." for libs, (like DLLs, a bit like system32 & progfiles in some ways)
-"usr/shared/..." a place to store shared app 'stuff' like icons etc.
-"/home/...." similar to documents and settings on windoze.
-"/etc/..." for config files.

but its quite different from windows in many ways and is not set in stone.

For more simple personal applications like games you normally simply unpack the zip/tar to a folder in your home dir.


Brucey(Posted 2007) [#5]
And then of course there's /usr/local/xxxxx hierarchy :-)

/usr/local/bin
/usr/local/lib

etc


D4NM4N(Posted 2007) [#6]
whats exactly is the local for, as in whats local about it :?


Picklesworth(Posted 2007) [#7]
The file structure is designed around the idea of connecting computers (for example, like thin clients), such that one's user account is stored on a main server but is accessed from many different Linux-based boxes by remotely mounting folders.

/usr/local has data specific to the current computer in use, whereas other locations have data that exists for all users regardless of which client (host) they are using.
That isn't very commonly implemented in reality, though, so it tends to be that default data for the distribution goes in /usr, while extra stuff goes in /usr/local.