Linux program files located

Where is the default folder for Apps? [duplicate]

I am relatively new to the linux world. I use OSX at home and Windows at work. In those worlds, there is a default folder for applications ( C:\Program Files , /Applications ). Is there any such directory in Ubuntu? I understand that this is not very important and any location in the file system should be ok, but was just wondering whether there are such standard locations (I think there would be one). For instance where is Firefox or Libre Office (that are installed by default)? Got this question when I was trying to install eclipse. Downloaded the zip, and was wondering.

1 Answer 1

Ubuntu (Linux) follows the filesystem hierachy structure. There is a description of the main directories in that link.

The location where software gets installed depends on how you install it. If you use the most obvious method (Ubuntu Software Center/ .deb ‘s) it generally gets installed to the default locations. In that case libraries will end up in /usr/lib/ (Libraries for the binaries in /usr/bin/ and /usr/sbin/ .) and the executable in /bin (Essential command binaries that need to be available in single user mode; for all users, e.g., cat , ls , cp ), /usr/bin or /usr/sbin (Non-essential command binaries (not needed in single user mode); for all users).

Some other important directories are /opt and /usr/local/share .

/opt : Optional application software packages. Jasperserver (a stand-alone and embeddable reporting server) for instance installs into /opt .

/usr/local is for data that must be stored on the local host and is used for installing software/data that are not part of the standard operating system distribution. In this directory you will find lib for libraries en bin for executables.

You can use system settings , main menu to browse for executables. Or from command line with locate . Or inside Ubuntu Software Center you can browse all the files that are used for a package. Examples using locate and libreoffice :

locate libreoffice|grep bin 

will show /usr/bin/libreoffice .

Sidenote: Eclipse is in the software center so no need to download a zip (unless you want the newest version and not the most stable one):

Читайте также:  Linux how to disable user

Источник

How can i find the location of installed software in linux?

Is there any command that I can use in the console to know the location of installed software in linux? i have copied a xyz.bin from windows machine to linuxdesktop and installed it. more over can you please tell me how to uninstall a software which is installed in linux Thanks in advance

You might be able to use the find command to search for it. Have a look at this unix.stackexchange.com/questions/19369/…

3 Answers 3

to find the path where the binary is linked to.

Other application specific files may reside in

The way a package is installed/uninstalled on Linux depends on either the specific Linux distribution AND the specific package.

Since you have used a .bin file for installation, it is likely that you have an uninstall command specific for your program in the path.

If you provide more information about the package and the Linux distribution, we can give more help.

It depends on the distribution you’re using. Supposing you are using a debian\ubuntu distribution, you can uninstall it by the apt command, using sudo apt-get remove software_name sudo apt-get purge software_name

Of course you need to have root privileges.

The softwares are usually installed in bin folders, in /usr/bin, /home/user/bin and many other places, a nice starting point could be the find command to find the executable name, but it’s usually not a single folder. The software could have components and dependencies in lib,bin and other folders.

Источник

How do I find where Linux application binary files exist?

Where does Linux (e.g., CentOS, RHEL) store the binary files for a given application? How can I find it out for an application?

It’s unclear whether you mean «executable binary file» (the actual command, which in fact may not be a compiled binary at all) or «binary data file». What is the issue that you are currently having? Are you, for example, trying to find the executable associated with a particular package?

5 Answers 5

You can use whereis for this task.

$ whereis python3 python3: /usr/bin/python3.5m /usr/bin/python3 /usr/bin/python3.5 /usr/lib/python3 /usr/lib/python3.5 /etc/python3 /usr/local/lib/python3.5 /usr/share/python3 /usr/share/man/man1/python3.1.gz 

And while whereis checks the standard path, you can also use which to check the actual path (though it won’t find «shadowed» duplicates).

Читайте также:  Monect pc remote linux

To find the binary itself, another method is type .

$ type python3 python3 is /usr/bin/python3 $ 

In terms of location for configuration files and data files, the best place to determine that is often the relevant man page.

$ man python3 | grep -A10 FILES FILES AND DIRECTORIES These are subject to difference depending on local installation conven‐ tions; $ and $ are installation-dependent and should be interpreted as for GNU software; they may be the same. The default for both is /usr/local. $/bin/python Recommended location of the interpreter. $/lib/python $/lib/python $ 

You might try using which like so:

which is likely a symbolic link, so to find the actual real path

ls -la $(which zoom) lrwxrwxrwx 1 root root 22 Apr 24 07:19 /usr/bin/zoom -> /opt/zoom/ZoomLauncher 

In case that gives another symlink (it doesn’t in the case of zoom), you can use namei to traverse the chain.

In general, refer to the file-system-heirarchy (FSH) for this:

A direct (and simplified) answer to your question is:

  • binary files:
    • /usr/bin for executables
    • /usr/lib for shared objects (libraries)
    • /etc
    • /var for read-write stuff
    • /usr/share for architecture-independent, read-only data (like images)

    If you are using a debian-based system, you can find what files are deployed by a specific application (package) with dpkg -L :

    $ dpkg-query -L xclip /usr/bin/xclip /usr/share/doc/xclip/README /usr/share/doc/xclip/changelog.Debian.gz /usr/share/doc/xclip/changelog.gz /usr/share/doc/xclip/copyright /usr/share/man/man1/xclip.1.gz 

    In this (abbreviated) case, we see package xclip has a binary in /usr/bin , some changelog and copyright stuff in /usr/share/doc/xclip and a man page in /usr/share/man/man1 .

    Other distros have other tools for the same thing.

    Shellscript what-about

    I use the shellscript what-about in order to show some basic information of executable programs, that are available via PATH ,

    • where it is located
    • what package it belongs to or can be installed from
    • what kind of program it is (binary executable code, shellscript, shell built-in, alias, link . )

    This bash shellscript uses the tool dpkg , that belongs to Debian and Ubuntu and can be used also in Linux distros developed from those two distros. If you want to see the whole content of a [debian] program package, you can use dpkg or emacs according to this link to AskUbuntu.

    If you want to find the program package the program belongs to in some other distro, CentOS and RHEL were mentioned in the original question, you must replace dpkg with the corresponding tool.

    #!/bin/bash LANG=C inversvid="\0033[7m" resetvid="\0033[0m" if [ $# -ne 1 ] then echo "Usage: $ " echo "Will try to find corresponding package" echo "and tell what kind of program it is" exit 1 fi command="$1" str=;for ((i=1;i<=$(tput cols);i++)) do str="-$str";done tmp="$command" first=true curdir="$(pwd)" tmq=$(which "$command") tdr="$" tex="$" if test -d "$tdr"; then cd "$tdr"; fi #echo "cwd='$(pwd)' ################# d" while $first || [ "$" == "l" ] do first=false tmp=$ tmq="$tmp" tmp=$(ls -l "$(which "$tmp")" 2>/dev/null) tdr="$" tex="$" if test -d "$tdr"; then cd "$tdr"; fi # echo "cwd='$(pwd)' ################# d" if [ "$tmp" == "" ] then tmp=$(ls -l "$tex" 2>/dev/null) tmp=$ if [ "$tmp" == "" ] then echo "$command is not in PATH" # package=$(bash -ic "$command -v 2>&1") # echo "package=$package XXXXX 0" bash -ic "alias '$command' > /dev/null 2>&1" > /dev/null 2>&1 if [ $? -ne 0 ] then echo 'looking for package . ' package=$(bash -ic "$command -v 2>&1"| sed -e '0,/with:/d'| grep -v '^$') else echo 'alias, hence not looking for package' fi # echo "package=$package XXXXX 1" if [ "$package" != "" ] then echo "$str" echo "package: [to get command '$1']" echo -e "$$$" fi else echo "$tmp" fi else echo "$tmp" fi done tmp=$ if [ "$tmp" != "" ] then echo "$str" program="$tex" program="$(pwd)/$tex" file "$program" if [ "$program" == "/usr/bin/snap" ] then echo "$str" echo "/usr/bin/snap run $command # run $command " sprog=$(find /snap/"$command" -type f -iname "$command" \ -exec file <> \; 2>/dev/null | sort | tail -n1) echo -e "$file: $sprog$resetvid" echo "/usr/bin/snap list $command # list $command" slist="$(/usr/bin/snap list "$command")" echo -e "$$slist$resetvid" else package=$(dpkg -S "$program") if [ "$package" == "" ] then package=$(dpkg -S "$tex" | grep -e " /bin/$tex$" -e " /sbin/$tex$") if [ "$package" != "" ] then ls -l /bin /sbin fi fi if [ "$package" != "" ] then echo "$str" echo " package: /path/program [for command '$1']" echo -e "$ $package $" fi fi fi echo "$str" #alias=$(grep "alias $command=" "$HOME/.bashrc") alias=$(bash -ic "alias '$command' 2>/dev/null"| grep "$command") if [ "$alias" != "" ] then echo "$alias" fi type=$(type "$command" 2>/dev/null) if [ "$type" != "" ] then echo "type: $type" elif [ "$alias" == "" ] then echo "type: $command: not found" fi cd "$curdir" 

    This shellscript can find a program that is ‘behind’ a link or a series of links.

    See also this link to AskUbuntu, where there are some demo examples.

    Источник

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