Linux
1. As a regular user, search the /etc directory for every file named passwd. Redirect error messages from your search to /dev/null.
2.Find files under the /usr/share/doc directory that have not been modified in more than 300 days.
3. Find all files on your system which are longer than 1 MiB, and output their names.
4. How could you use find to delete a file with an unusual name (e. g., containing invisible control characters or umlauts)?
5. How would you ensure that files in /tmp which belong to you are deleted once you log out?
6. README is a very popular file name. Give the absolute path names of all files on your system called README .

11 Июн 2019 в 19:47
314 +1
0
Ответы
1

As a regular user, you can use the following command to search the /etc directory for every file named passwd and redirect error messages to /dev/null:

find /etc -name passwd 2>/dev/null

You can find files under the /usr/share/doc directory that have not been modified in more than 300 days using the following command:

find /usr/share/doc -type f -mtime +300

To find all files on your system which are longer than 1 MiB and output their names, you can use the following command:

find / -size +1M -type f -exec ls -lh {} \;

To delete a file with an unusual name using find, you can use the following command:

find . -type f -name 'file_with_unusual_name*' -exec rm {} \;

To ensure that files in /tmp which belong to you are deleted once you log out, you can use a tool like tmpwatch to clean up files older than a certain time. You can add a cron job to run tmpwatch at regular intervals.

To find all files on your system called README, you can use the following command:

find / -name README -type f
21 Апр в 01:16
Не можешь разобраться в этой теме?
Обратись за помощью к экспертам
Название заказа не должно быть пустым
Введите email
Бесплатные доработки
Гарантированные бесплатные доработки
Быстрое выполнение
Быстрое выполнение от 2 часов
Проверка работы
Проверка работы на плагиат
Интересные статьи из справочника
Поможем написать учебную работу
Название заказа не должно быть пустым
Введите email
Доверьте свою работу экспертам
Разместите заказ
Наша система отправит ваш заказ на оценку 92 493 авторам
Первые отклики появятся уже в течение 10 минут
Прямой эфир