Linux at top level

What is the intended purpose of top-level linux/unix directories and what should they contain? [duplicate]

I would also like answers for the sub-directories of these, e.g. /usr/lib /usr/local/ /var/lib etc. please.

I know that there are other factors that can influence the above items but am just looking for answers to my question here.

duplicate (original includes pretty pictures in the answers): superuser.com/questions/548/linux-file-system

Thanks ~quack the diagrams are great. I hope I have helped others by asking the same question in a different way to help their search. Up-voted your comment.

so I would hope we could keep this question for that reason and not remove it. Up-voted your comment. Thanks.

3 Answers 3

What you’re looking for is the Filesystem Hierarchy Standard. Answers to all the questions you ask are covered in the FHS.

With regard to writing applications that conform to any Linux distribution, you may also want to look at the XDG Base Directory Specification. It is more desktop/user oriented.

I’m accepting this as the answer as it mentions advice («XDG») about how to write applications for any Linux distribution. But I should say, all answers here are great and of help and thanks for the rapid response. I’m grateful to ~quack for mentioning the friendly diagram in the comment below the question ( superuser.com/questions/548/linux-file-system

The Filesystem Hierarchy Standard is probably the best reference here (see Wikipedia’s entry and the full text in various formats), as recommended by the LSB. Though no distribution that I know of completely fits the standard, most are close so it is a good reference for deciding your own «best practise».

There is a standard structure called Filesystems Hierarchy Standard (FHS). Some linux dists adhere to it, some don’t.

In simple terms, when it comes to /usr and /var, you can say that /usr are user installed files that don’t change and /var are for files that do change(spool, formatted documentation). This is so you can , for example, mount /usr over a network and have several computers that share the «static» /usr/ and have a local /var for files that are «dynamic».

Читайте также:  Смена пароля другого пользователя linux

Unchanging data files for programs and subsystems, including some site-wide configuration files. The name lib comes from library; originally libraries of programming subroutines were stored in /usr/lib.

The place for locally installed software and other files. Distributions may not install anything in here. It is reserved solely for the use of the local administrator. This way he can be absolutely certain that no updates or upgrades to his distribution will overwrite any extra software he has installed locally.

Files that change while the system is running normally.

Источник

Команда top в Linux.

В данной статье рассмотрим описание команды top в linux и разберемся как ей пользоваться, познакомимся с возможностями.
Команда top обеспечивает вывод изменяющейся в реальном времени информацию о процессах.
Вывод утилиты top включает в себя большое количество информации, такую как: средняя загрузка, количество запущенных процессов, состояние процессора, информация о свободной памяти.

В таблице процессов выводятся процессы в порядке потребления ресурсов процессора от большему к меньшему:

- PID; - пользователь; - приоритет; - использование CPU и памяти; - время выполнения; - имя программы.

 top_linux

Разберем вывод команды top на примере.

top — 16:14:%2 up 53 min, 1 user — видим текущее системное время, время «uptime», количество пользователей в данный момент в системе.

В первой строчке параметр «load averages» отображается три параметра: 0,24, 0.09, 0.07.
Первый параметр показывает загрузку средняя загрузку сервера за последнюю 1 минуту до ввода команды top, второй параметр за 5 минут и третий параметр за 15 минут.

Вторая строка, показывает «Tasks«:

total - общее количество процессов; running — выполняющиеся в данный момент; sleeping — процесс находится в спящем режиме; stopeed - остановленные процессы; zombie — процесс, который является дочерним процессом, который фактически уже не выполняется, но его родительский процесс еще запущен и в состоянии работы;
us — процент времени на выполнение процессов пользователей, для которых не задан приоритет; sy — процент времени, на выполнение процессов ядра, использование CPU системой; ni — процент времени на выполнение процессов с заданных приоритетом; id — «простаивающая» вычислительная мощность; wa — процент времени на выполнение операций IO (ввода/вывода), то есть дисковых операций. Чем медленнее диск, тем выше будет значение для каждого процесса; hi — процент времени на обработку аппаратных прерываний (на уровне железа); si — процент времени на обработку программных прерываний (на уровне программном); st — мера загруженности гипервизора;

Четвертая и пятая строки, «Mem» и «Swap»:

total — общий объем оперативной памяти; used — объем используемой памяти; free — объем свободной памяти; buffers — объем буфера; cached — объем кэша операций ввода/вывода.

Далее разберем значения столбцов:

PID — идентификатор процесса; USER — пользователь, который запустил процесса; PR — динамический приоритет процесса; NI — статический приоритет процесса; VIRT — объем использования виртуальной памяти; RES — объем использования реальной оперативной памяти; SHR — объем использованной shared-памяти; S — статус процесса (R - running, S - sleep, I - простой, Z - zombi, T - остановлен;); %CPU — использование процессорного времен; %MEM — использование реальной оперативной памяти; TIME — время работы процесса с момента запуска; COMMAND — имя процесса.
Управление командой top.

1. Стрелками клавиатуры «вверх«, «вниз«,»вправо«, «влево» можно прокручивать список процессов.

Читайте также:  Pycharm kali linux установка

2. Нажатие клавиши z позволяет переключиться на цветное изображение.

3. Нажатие клавиши 1 выводит обобщённую информацию о загрузке процессора в одной строке, либо в нескольких строках по каждому ядру.

4. Нажатие клавиши m переключает вид строки «Mem» в четырех режимах:
— по умолчанию — подробные проценты по типу памяти;
— сокращённый % используемая/общая доступная + гистограмма
— сокращённый % используемая/общая доступная + блок-диаграмма
— выключение показа памяти.

5. Кнопкой i можно переключаться между всеми или только активными процессами.

6. Посмотреть строку команды, которой она была запущена можно с помощью кнопки c.

7. Показ процессов в виде дерева родительских и дочерних процессов через клавишу shift + v.

Добавить комментарий Отменить ответ

Этот сайт использует Akismet для борьбы со спамом. Узнайте, как обрабатываются ваши данные комментариев.

Источник

Top Level Directories in Linux

panorama-079.jpg

panorama-079.jpg

Here are the top level directories in your Linux system, with a brief explanation of the purpose of each:

/ : The top level directory in your system. It’s called the root directory, because it’s the root of the system: all the rest of the directory structure emanates from it like branches from the root of a tree. Don’t get confused by the /root directory, by the way; that’s a different ‘root’.

/bin : Contains binaries for your system. The /bin directory is, by default, in your PATH, meaning that any executable file in this directory can be executed just by entering the file name at the command line.

/boot : Contains files necessary to boot your system, including the kernel.

/dev : An abstracted directory which contains all your system devices: hard drives, CD-ROMs, sound cards, and much, much more. When devices are mounted, it occurs here.

Читайте также:  Ocs inventory agent for linux

/etc : Contains most of the system and application configuration files your Linux machine uses. Back this directory up regularly.

/etc/skel : «skeleton» files used to create user accounts.

/home : Contains the home directory for each system user.

/lib : System modules, software libraries, & information databases, shared by various applications & the system itself.

/opt : Optional software that you installed.

/proc : Another abstracted directory which is created when the system boots. Contains information about the processes on your system.

/root : The home directory of the root user.

/sbin : Contains additional system binaries that are only available to root. Mostly admin tools.

/tmp : The temporary directory. Any user can place stuff in here, but be forewarned: your system periodically cleans out this directory, and anything you leave in here will be deleted.

/usr : Contains subdirectories that will be used system-wide by all users, including binaries, libraries, man files, and other things.

/usr/doc : Program documentation.

/usr/info : Program documentation.

/usr/lib : Program libraries (shareable system program modules).

/var : Contains variable data that changes in size as the system runs. For instance, log files, mail directories, databases, and printing spools.

Источник

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