Linux basics 1
Практика 1 Основы Linux
Выполнил Андреев Игорь Константинович
Часть 1 - Работа в командной строке
1.1 Посмотреть под каким пользователем в системе Linux
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.2 Перейти в корневой каталог
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.3 Посмотреть содержимое каталога
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.4 cd, chdir (англ. change directory — изменить каталог) — команда командной строки для изменения рабочего каталога в Unix, DOS и других операционных системах
ls (dir, vdir) — утилита Unix, которая печатает в стандартный вывод содержимое каталогов
1.5 Посмотреть из корневого каталога содержимое директории Home
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.6 Перейти в директорию /tmp
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.7 Создать директорию /pt
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.8 Создать 3 текстовых документа 1.txt 2.txt 3.txt
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.9 Изменить или добавить содержимое текстового документа с помощью редакторов nano и vim
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.10 Скопировать и переименовать директорию с файлами
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.11 Заархивировать директорию
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.12 Разархивировать директорию
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.13 Посмотреть содержимое домашней директории и каталога usr одной командой
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.14 Посмотреть содержимое каталога в обратном порядке
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.15 Посмотреть права на директорию
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.16 Посмотреть права на текстовые файлы.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.17 Переместить и переименовать один текстовый файл в директорию /tmp
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.18 Создать новую директорию, в ней создать новый текстовый документ, переместить из директории /tmp файл в новую директорию с заменой файла и запросом на его изменение
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.19 Определить местоположение данного исполняемого файла ls, cd
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.20
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.21 Создать символические ссылки
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.22 Создать символическую ссылку в никуда, продемонстрировать её
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.23 Создать прямые ссылки
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.24 Создать собственную команду, которая будет использовать следующее: cd /usr; ls; cd - , с помощью alias
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.25 С помощью команды cat написать любой текст и записать его в текстовый файл
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.26 Удалить один текстовый файл
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.27 Создать пустую директорию и удалить её
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.28 Удалить директорию с 3-я текстовыми файлами
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.29 Создать пользователя
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.30 Поменять пароль нового пользователя
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
1.31 Найти текстовый документ с помощью команд Find и Grep
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →

1.32 Воспользоваться логическими 'и' и 'или' как пример использовать команду ping


Часть 2 - Практическая работа “GREP”
2.1 Вы проводите поиск в Интернете, и видите, что используются две разные версии Python, и вы не знаете, какая из них был установлен в вашей системе установщиком Ubuntu или Debian, и устанавливал ли он какие-либо дополнительные модули?

2.2 Допустим, у вас возникли проблемы с вашим веб-сервером Apache, и вы обратились к одному из многих форумов в сети с просьбой о помощи. Добрая душа, которая вам ответила, попросила вас отправить содержимое вашего файла /etc/apache2/sites-available/default-ssl. Разве вам не было бы легче, если бы вы могли просто удалить все закомментированные строки?

2.3 Например, предположим, что у вас есть целая папка, полная музыкальных файлов разных форматов. Вы хотите найти все файлы .mp3 у исполнителя ABC, но вы не хотите никаких ремиксов. Как поступить?

2.4 Как отобразить количество строк до или после строки поиска?

2.5 Как вывести количество строк совпадения?

2.6 Как выяснить количество совпадений?

2.7 Как найти файлы по заданным номерам строк?



2.8 Произвести поиск рекурсивной строки во всех каталогах

2.9 Произвести поиск строк в архивах файлах Gzip

Часть 3 - Практическая работа Философия Vim
3.1 Установка

3.2 Создание файла и запуск Vim




3.3 Перемещение
h — перемещение влево
j — перемещение вниз
k — перемещение вверх
l — перемещение вправо
Также есть дополнительные функции навигации, вот несколько наиболее важных:
- gg — переход в начало документа
- G — переход в конец документа. Если предварительно ввести номер — переместиться на строку с этими номером
- w — перемещение к следующему слову. Если предварительно ввести количество — переместиться на это количество слов
- b — перемещение к предыдущему слову. Если предварительно вввести количество — переместиться на это количество слов назад
- e — перемещение к концу слова. Если предварительно указать количество — переместиться на указанное количество слов
- 0 — перемещение к началу строки
- $ — перемещение к концу строки

3.4 Поиск текста

3.5 Редактирование
Удаление текста
- x — удалить символ на позиции курсора
- d — удалить в заданном командой перемещения направлении. Например, “dl” удаляет один символ справа
- dd — удалить строку
- D — удалить все символы от положения курсора до окончания строки
- Замена текста
- r — заменить символ на позиции курсора заданным после команды символом
- c — заменить в заданном командой перемещения направлении. Например, “cb” заменяет предыдущее слово. Для набора текста на замену запускается режим вставки.
- C — заменить до окончания строки. Текст на замену набирается в режиме вставки.

Копирование и вставка
- y — копировать в заданном далее направлении
- yy — копировать всю строку
- Y — копировать до окончания строки
- p — вставить последнюю скопированную (или удаленную!) строку ниже текущей
- P — вставить последнюю скопированную (или удаленную!) строку выше текущей

Дополнительные команды редактирования
- u — отменить последнее действие
- <ctrl>-r — вернуть последнее отмененное действие
- J — присоединить строку ниже к текущей

3.6 Командный режим
Команды управления
- :q — выход из программы. Действие не будет выполнена, если не сохранить изменения
- :q! — выход из программы с отменой всех изменений, которые не были сохранены
- :w — сохранить изменения. При первичном сохранении или сохранении в другой файл укажите имя через пробел
- :e — редактировать указанный далее файл
- :bn — редактировать следующий файл (если открыто несколько файлов)
- :bp — редактировать предыдущий файл (если открыто несколько файлов)
- :qw – сохранить файл и выйти

3.7 Объединение команд

Часть 4 - vimtutor











