What is bin directory in linux

Purpose of Bin Directory [closed]

Requests for learning materials (tutorials, how-tos etc.) are off topic. The only exception is questions about where to find official documentation (e.g. POSIX specifications). See the Help Center and our Community Meta for more information.

Could anyone please describe what the purpose of the Bin Directory in Linux is?
I have already had a browse online, but couldn’t find a brief, yet comprehensive, answer.

Try searching Google with the phrase «what is the linux bin directory for». The first hit seems to be pretty clear to me.

First hit is this question. Let’s remember that Google results change with time and by the user, and this is a site for answering questions.

2 Answers 2

Bin is an abbreviation of Binaries. It’s just a directory where a user of an operating system can expect to find applications.

The different directories on a Linux system can be daunting or confusing if you aren’t used to them. There’s a good overview on wikipedia that explains what each standard directory is for.

It contains essential binary files (unlike /usr/bin directory) also for booting. It usually contains the shells like bash and commonly used commands like cp , mv , rm , cat , ls .
Unlike /sbin , the bin directory contains several useful commands that are of use to both the system administrator as well as non-privileged users.

In modern Linux, anyway, the distinction between /bin and /usr/bin is fairly obsolete, though it may hold in some other Unixes. (The original purpose of /bin — to hold enough of a system to boot successfully until you could mount /usr — is now served by initrd/initramfs; many distributions now put all system applications in /usr/bin and make /bin a symlink there.)

Источник

Linux Directory Structure explained: /bin folder

The Linux Juggernaut

This is second post in our Linux directory explanation series. /bin is one more important folder. Bin stands for binary which means an executable file. This folder contains commands or scripts or executable which can be executed to accomplish a task. We have some cousins to this folder as given below along with bin folder.

Let’s start with /bin folder.

1./bin folder

/bin: Stands for binary. This folder contains base executables which are required for minimal system working. These commands are available in runlevel 1 for basic administration. Commands which are available in /bin folder is accessed by every one and can run by every user. This folder contains basic commands such as cat, chmod, chgrp, chown, date, dir, dd, df, ln, mv, echo and zipping tools such as bzip, gzip etc.

2./sbin folder

/sbin: This folder stands for system binaries or super user binaries. This folder contains commands which are required for changing system properties or system level settings such as disk management, network management etc. This folder is accessed some times by normal user but they can not execute any of the commands located in this and what ever commands/scripts located in this folder are run only by root user. If you want to make normal user to run these commands you have to implement SUDO or Powerbroker to give elevated access. Some of the commands available in this folder are chkconfig, dhcpclient, fsck and it’s related commands, ifconfig and it’s related commands, init and it’s related commands, lvm and it’s related commands etc.

Читайте также:  Linux flash player x64

3./usr/bin folder

/usr/bin: This folder is similar to /bin. This folder contains normal commands which are an extend set of commands to /bin folder for normal user and not that much essential to run the machine. This folder contains commands such as at, atq, bc, awk, cal, cmp, dig, diff, du, env, find, free, ftp, gcc, groups, id, info iostat, last, lsof, md5sum, nmap, rar, seq, tail, top, vi, unzip, who.

4./usr/sbin folder

/usr/sbin: This folder is similar to /sbin. This folder contain system commands which are an extend set of commands to /sbin folder for root user and not that much essential to run the machine. This folder contain commands such as arp, adduser, cron, cups related commands, grub related commands, kvm, ppp related commands, tcpdump etc.

5./path/to/some/bin

Some times you will see bin folder in other locations such as /usr/local/bin this is the place you can see some of the binaries which are installed on the system locally. Some time you can see a bin folder in /opt which indicates that some binaries are located in this /opt bin folder.

6./path/to/some/sbin

Some times you will see bin folder in other locations such as /usr/local/sbin this is the place you can see some of the binaries which are installed on the system locally and are system related commands. Some time you can see a sbin folder in /opt which indicates that some binaries are located in this /opt/bin folder.

PATH variable is one of the important variable related to this binaries. To know more about PATH variable read our post on path variable.

stay tuned to our next post on /dev folder

Surendra Anne

Mr Surendra Anne is from Vijayawada, Andhra Pradesh, India. He is a Linux/Open source supporter who believes in Hard work, A down to earth person, Likes to share knowledge with others, Loves dogs, Likes photography. He works as Devops Engineer with Taggle systems, an IOT automatic water metering company, Sydney . You can contact him at surendra (@) linuxnix dot com.

Latest posts by Surendra Anne (see all)

  • Docker: How to copy files to/from docker container — June 30, 2020
  • Anisble: ERROR! unexpected parameter type in action: Fix — June 29, 2020
  • FREE: JOIN OUR DEVOPS TELEGRAM GROUPS — August 2, 2019
  • Review: Whizlabs Practice Tests for AWS Certified Solutions Architect Professional (CSAP) — August 27, 2018
  • How to use ohai/chef-shell to get node attributes — July 19, 2018

Источник

what do these directory is used for in linux? etc/ bin/ and lib/ [closed]

You can read all about the details by looking up the filesystem hierarchy standard, but in a nutshell:

  • /etc : Configuration information
  • /lib : Libraries
  • /bin : Program binaries that are important to the functioning of the system. (Non-essential binaries are generally found in /usr/bin ; these are generally installed with the operating system distribution. Programs installed after OS installation are generally stored in /usr/local/bin .)
  • etc -> To keep configuration files
  • lib -> To keep libraries that can be used by installed software or other softwares in your system.
  • bin -> Binary files
Читайте также:  Точки монтирования при установки linux

hi @shadyabhi, do you happen to know /var/log/messages this folder too? what is it used for? im trying to find it in my system, it cant be found

/var/log/messages That will be a file & it may exist or it may not depending on how syslogging is configured on your system. I can’t say anything about why it isn’t present without getting your configuration file for your syslogging program.

@ruggedbuteducated /var/log/ is a directory generally used for storing logs. All programs generally write to /dev/log file socket which is picked up by syslog program such as syslog-ng or rsyslog etc etc. Then this syslog program reads from that file socket and depending on which program is sending logs, write to a appropriate file under /var/log/ generally. Generally, messages is present and programs write to it most. You can check what are your recent files in /var/log by using ls -ltr /var/log . It could be everything.log or messages.log etc etc.

bin — Contains binary files to configure the operating system.(In the binary format)_________ etc — contains machine specific configuration files in editable format. _________ lib -> contains shared binary files which are shared by bin and sbin.

Источник

/etc /bin /etc /dev – Linux Filesystem Directories and What’s in Them

/etc /bin /etc /dev - Linux Directories and What's in Them

If you’re new to the Linux operating system, you might be a bit confused about exactly what is stored where on your hard drive. Directories like /etc and /bin might seem confusing to you if you’re used to Windows‘ directory structure. This article will tell you what everything is.

As an end-user, you’ll probably only need to worry about the actual contents of a few of these directories – /home, /etc/, /var, /srv, /media.

The contents of the other directories are mostly managed by package managers (for installing software) and system services (for device management etc.).

A Note on Permissions

Most users won’t have permission to modify (and sometimes even read) many of the below directories. Generally, non-administrative users will only be guaranteed permission to write to their directory in /home.

The Filesystem Root (/)

The filesystem root is the top level of the file storage system on your computer. It contains all of the files and directories accessible on your computer.

It is accessible at the location /.

Other file systems (including those on other physical devices), to be accessible, are usually mounted under a directory in the root filesystem called a mount point.

Thus, there are no drive letters like in windows – everything will appear somewhere under /.

Binaries (/bin)

The /bin directory holds the binaries (executable programs) essential for system operation. This includes things like the bash shell and other programs that must be loaded for a functional computer system.

Boot (/boot)

The /boot directory holds the files that Linux OS needs to boot. This includes the boot-loader.

Devices (/dev)

Linux represents attached devices as files in the file system (which is super convenient when scripting). These file representations of devices are stored in /dev.

Be warned that these aren’t real files – you can’t copy a sound card onto a USB stick – they are just representations of the device on the file system so that they can be easily accessed and interacted with by programs on the system.

Читайте также:  Ipsec vpn туннель linux

Configuration (/etc)

Most users will wind up modifying the contents of /etc. This is the directory where system-wide configuration files are stored, and if you’re running a server of some kind (Apache, MySQL), the configuration files for it will appear somewhere in here.

Home Directories (/home)

The /home directory contains each user’s own files in a subdirectory, usually named for the username of the user.

For example, the user tim would probably find his home directory at /home/tim.

Per-user configuration is also stored in the user’s own home directory.

/root (Root’s Home)

The home directory, but for the system’s administrative root user.

This is not the root filesystem but the home of the root user.

Code Libraries (/lib)

Code libraries required by the essential programs in /bin and /sbin are stored in the /lib directory.

Lost & Found (/lost+found)

If corrupted files are found after a crash or after a device is disconnected unexpectedly, and they are later found, they’ll appear in the /lost+found directory for recovery purposes.

You might see this directory appear on your USB sticks as well – this directory is created on any filesystem on a Linux system where recoverable files are found.

Removable Media (/media)

This is where removable media such as USB sticks will be mounted for use. The /media directory should contain a subdirectory for each attached removable storage device (such as a USB stick or CD-ROM).

Linux systems that are set up to mount removable storage automatically will usually mount them here. If you’re manually mounting a drive, it’s worth mounting it here also for consistency.

Optional Packages (/opt)

/opt is a directory for optional (non-system-essential) software packages to put their files. It’s usually used by packages that don’t have a structure that will conform to placing files in the /usr/bin and /usr/lib directories.

Process Files (/proc)

This directory contains a file representation of the running system processes. Like /dev, the contents of /proc are not real files.

System Binaries (/sbin)

Similar to /bin, /sbin contains essential system binaries which are intended for system administration.

Temporary Files (/tmp)

Does what it says on the tin. Temporary files go in /tmp.

User Binaries (/usr)

The /usr folder contains programs intended for the user which aren’t vital to the systems operating functions.

Whereas the Bash Shell executable will probably be located in /bin – as it’s essential for the operating of your system – your web browser will probably be in the /usr directory as it isn’t essential to the operating system.

This distinction is made so that the contents of /usr can be mounted after the system is booted and all essential software is loaded – so that it can be stored on another physical device if need be.

Inside the /usr directory are /usr/bin and /usr/lib which are analogous to /bin and /lib – but for their non-essential software counterparts.

Variable Data (/var) & Service Data (/srv)

These two directories will contain the data used by various services on the system that don’t necessarily belong to a specific user (and thus don’t belong in their home directory).

The Apache web server by default stores the web page files it serves in either /var or /srv.

The system will store log files in /var/log.

Источник

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