Нет команды man linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

man command not found on git bash #249

man command not found on git bash #249

Comments

man doesn’t seem to be installed on git bash — learners get a «man: command not found» error when they try to use it.

The text was updated successfully, but these errors were encountered:

As a workaround, I’ve installed TLDR pages and set it as the default keyword search tool with :set keywordprg=tldr . Thought I’d add my solution here since this is one of the first google results.

I add this to my .bash_profile
man()

so you need to add the semicolon after the function like below
man()

There’s no gets —help but there’s man gets . Man is more than just help for your bash commands

Does anyone know a way to manually install man pages into git bash? man obviously comes with a lot more than just —help . Just look at the man pages for ssh or scp in comparison to what —help gives you.

Does anyone know a way to manually install man pages into git bash?

Not out of the box. If you really need man you might want to install https://www.cygwin.com/.

As a workaround, I’ve installed TLDR pages and set it as the default keyword search tool with :set keywordprg=tldr . Thought I’d add my solution here since this is one of the first google results.

Hey thanks man. This worked like a charm.

It’s also possible to use the regular MSYS2 installer, install git , nano , and man-pages-posix using pacman , and you’ll have roughly the same setup as Git for Windows (which is based on MSYS2 anyway), except you’ll have the real man pages, and the ability to install other packages when you need them.

pacman -S git nano man-pages-posix

(admittedly, not the best solution for a classroom full of people learning to use the command line for the first time)

Читайте также:  Drivers linux acer aspire one

If you’re using Git a lot and don’t like typing in passwords to push and pull from remotes, this is a minor step backward, because you probably won’t get the Git for Windows credential manager, or its integration with your system certificate store.

Use —help. If you keep typing man out of habit, like me, paste this into the shell:

cat > ~/.bashrc myMan() < \$1 --help | less ># if man command not found, alias to myMan man 2>/dev/null if [ \$? -eq 127 ] then alias man=myMan fi EOF 

A lot of these solutions are clever, but, if we’re being honest with ourselves, they aren’t going to help the «learners,» as the original issue states, because the root of the problem is that Git Bash is not «real Unix.»

@elliotpryde’s suggestion is great, but honestly which student just going through these course materials for the first time is going to be using Vim, know that you can do man page lookups within it (with K in normal mode), or even recognize that that magic command needs to go in your ~/.vimrc ? (Elliot, you might want to update your comment to make that clear. )

And that’s sad, because man pages are one of the great things about a Unix environment, and it’s a shame to have to go, «oh, psych, that doesn’t work for you, because you have Git Bash,» to which the inevitable response is «What’s Git? I thought this was Unix?»

The Software Carpentry course materials do, if I recall, mention that you might need to use —help instead on Windows, might (or should) note that there’s a help command for Bash built-ins, and might even suggest using an online reference like https://linux.die.net. But as @umnikos points out, that’s not a proper substitute for being able to do man command right in the shell. At all.

Thing is, Git Bash is still the best thing going on Windows, for first-time learners, because MSYS2 and Cygwin are not complete solutions unless you know which packages to install. (I know, I know, there’s a Linux subsystem you can enable in Windows 10, but. baby steps.) So I think I’ll try to raise the issue with the Git Bash folks and see what they say. I’ll report back. 😉

This is gonna become moot in a couple of years — once Windows 7 leaves supported status, and hence everybody is hopefully on 10, there’s no longer a reason to use git bash rather than Win10’s built-in Ubuntu support 🙂

@swaldman3 Does this feature really ship with Windows 10 though? As of this writing, it looks like you have to sign up for some «Windows Insider» program to get access, probably have to wait for an update to download, then find the «developer mode» switch buried in the control panel and switch that on. And of course reboot. Also, who knows whether the «Home» version of Windows 10 will even have this capability.

Читайте также:  Подключить второй диск линукс

For workshops, maybe still not as straightforward as «here, download this free program from this web site (no signup required) and install it, then click on this icon in the Start menu.»

Yes, it really ships with Windows 10, including Home editions. Has done for a couple of years now. The only question mark in my mind is at the other end of the scale, with heavily locked down Enterprise installs — but they’d probably have trouble installing git bash too.

You don’t have to sign up for anything. You have to enable the «Windows subsystem for linux», and then install your chosen distro through the Microsoft Store, but these are not substantially harder to follow instructions for than installing git bash — there are probably fewer options to choose — and then you end up with a (to our intents and purposes) fully functional linux distro and none of the usual weirdnesses of no man, different line endings, etc.

Источник

Man-страницы в Linux. Как пользоваться. Установка

Man страницы в Linux

При работе в Linux иногда требуется чтение документации, руководств или help’ов. В Linux есть отличная документация, которая размещена в Man-страницах.

Что такое Man-страницы

Man-страницы (от слова manualруководство) — это целая библиотека в системе Linux, содержащая руководства по командам, утилитам, программированию и другим областям системы и не только.

Как открыть Man-страницы

Для чтения Man-страниц предназначена команда man .

Чтобы получить руководство по использованию какой-либо команды нужно выполнить команду:

Например, чтобы вывести руководство по команде wget, нужно выполнить команду:

man wget

Синтаксис команды man

В общем виде синтаксис команды man следующий:

Разделы

Man-страницы разделены по тематикам на разделы (на секции). Каждый раздел имеет свой номер. Всего существует 8 основных разделов.

Если вы не указали раздел, при выполнении команды man , то сначала будет выполнен поиск руководства в первом разделе, если его там нет, то во втором и так далее.

Например, откроем руководство по команде sleep. В данном случае будет использоваться первый раздел.

man sleep

А теперь получим справку по библиотечному вызову sleep языка программирования C (раздел 3):

man 3 sleep

Ниже представлена таблица с номерами разделов и их назначением (тематикой).

Номер
раздела
Описание
1 Основные команды.
2 Системные вызовы.
3 Библиотечные функции, включая стандартную библиотеку языка C.
4 Специальные файлы (обычно устройства из /dev ) и драйвера.
5 Форматы файлов и соглашения.
6 Игры и скринсейверы.
7 Разное.
8 Команды системного администрирования и демоны.

Для указания ссылок на Man-страницы часто используют следующую запись: имя(раздел) . Например, aporopos(1) , less(1) , exit(3) .

Поиск Man-страниц

Самая полезная опция команды man , это опция -k .

-k — поиск Man-страниц. Выводит список Man-страниц, в которых встречается искомый запрос.

Горячие клавиши и поиск внутри Man-страницы

Вверх , Вниз , Enter — просмотр (прокрутка) Man-страницы.
PgUb , PgDn , Пробел — постраничное пролистывание.

/ — поиск внутри страницы. Нажимаете клавишу / , при этом внизу появляется строка для ввода текста. Вводите текст, который вы хотите найти, и нажимаете Enter .
? — поиск в обратном направлении (снизу вверх). Аналогично нужно ввести текст для поиска и нажать Enter .
n — переход к следующему вхождению.
Shift+n — переход к предыдущему вхождению.
& — поиск внутри страницы, но вместо подсвечивания результатов, вывести только строки, где было найдено искомое слово.

h — открыть справку по командам и горячим клавишам. Чтобы закрыть справку, используется клавиша q .

Установка Man-страниц

Как правило, базовые man-страницы обычно всегда установлены в дистрибутивах Linux, но иногда их нужно устанавливать самостоятельно. Для установки Man-страниц выполните следующие команды.
Для Ubuntu:

sudo apt install man-db manpages
yum install man man-pages man-db

Для установки Man-страниц, содержащих описание библиотечных функций языка программирования C, выполните следующие команды.
Для Ubuntu:

sudo apt install manpages-dev manpages-posix-dev

Источник

Почему команды man и sudo не найдены?

Debian. Началось с того, что не найдена команда man. Попробовал её установить следующими способами:
sudo apt-get install manpages
sudo apt-get install man-db
Пишет что команда sudo не найдена, решил написать без неё, команда опозналась, но произошло следующее:

Скриншот фрагмента кода удалён модератором.

Простой 6 комментариев

Fernus

Репозитории не добавлены видимо.

xheirt

видно что у тебя только security патчи в списке репозиториев
например смотри сюда, твой /etc/apt/sources.list должен содержать что то типа такого:

deb http://deb.debian.org/debian bullseye main deb-src http://deb.debian.org/debian bullseye main deb http://deb.debian.org/debian-security/ bullseye-security main deb-src http://deb.debian.org/debian-security/ bullseye-security main deb http://deb.debian.org/debian bullseye-updates main deb-src http://deb.debian.org/debian bullseye-updates main

посмотри каких строк у тебя нет и добавь (можно еще non-free-firmware добавить)

после жми apt update и уже тогда apt install xxx

Повторю вопрос:
что лежит в /usr/bin/sudo и /usr/bin/man (это файлы а не каталоги), проверить например file /usr/bin/sudo
что показывает echo $PATH

TosterModerator

Фрагменты кода надо размещать в виде текста и оборачивать тэгом code для корректного отображения. Удобно делать кнопкой
Это обязательно, см.п.3.8 Регламента.
Сюда же относится traceback, ввод и вывод в консоли и другая структурированная текстовая инфа.

видно что у тебя только security патчи в списке репозиториев
например смотри сюда, твой /etc/apt/sources.list должен содержать что то типа такого:

deb http://deb.debian.org/debian bullseye main deb-src http://deb.debian.org/debian bullseye main deb http://deb.debian.org/debian-security/ bullseye-security main deb-src http://deb.debian.org/debian-security/ bullseye-security main deb http://deb.debian.org/debian bullseye-updates main deb-src http://deb.debian.org/debian bullseye-updates main

посмотри каких строк у тебя нет и добавь (можно еще non-free-firmware добавить)

после жми apt update и уже тогда apt install xxx

xheirt

6400d753d8880735524905.jpeg

Я немного не пойму, хочу войти в файл, чтобы изменить его, но не пускают в него

это текстовый файл, его надо отредактировать любым редактором, например nano или vim.tiny, так же его можно тупо заменить через cat>sources.list (только сначала сделай бакап копию)

xheirt

rPman, Всё сделал как Вы указали вышел, ошибок не было, вроде всё установилось отлично, но по итогу команда man всё равно неопознана
прошла загрузка apt update
прошла загрузка apt-get install manpages-dev
6400dc954974a561392388.jpeg
файл sources.list содержит следующее:
6400dde53ba05881360655.jpeg

xheirt

6400e05f7214c967959779.jpeg

rPman, В файле sudo вот это

а в man вообще пусто
PATH:

/usr/local/bin:/usr/bin:/usr/local/games:/usr/games

Источник

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