Заказчик
Заказчик opiweb | FL.RU

Заказчик

На сайте 10 лет (заходил 7 лет 5 месяцев 2 дня назад)
1
207.5
Рейтинг
207.5
Все (1)       Заказы (1)        Вакансии (0)       Конкурсы (0)
Разместить заказ
21 Марта 2018
По договоренности
контрольная Linux

1. a) cat both "~/today.txt" (make sure it exists) and "~/doesnotexist" (make sure it doesn't exist) in the same command. Send standard out to ~/stdout and standard error to ~/stderr. Truncation is fine (so overwrite the files if they exist).



b) run it again, but this time send standard err to the trash (/dev/null)



2. $1 is an important program, but sometimes it has errors that it sends to standard error. Append a timestamp (hint: "date") and both standard out and standard error to the log file $2. Be sure to append and not truncate.



3. Run a "following" tail of a $3 in the background. Append all output (both stdout and stderr) of $1 to $3. List all running jobs. Bring "tail" to the foreground. Now stop it using "ctrl+z". Send it back to the background. Kill the tail program using its job ID.



4. $5 is a program in directory $4. Directory $4 is not in your path. Thus, trying to run just "$5" should result an error. Run it anyway and send all standard error to the trash (/dev/null). Append the directory $4 to the current path, now run command $5, which should now work.



5. Print the default umask to the screen. Save this current umask to a variable. Now change your umask to one that would make the default file be created with permissions "741". Print the current umask to make sure it got changed. Now change the umask back to what it was before.



6. Take recursive ownership of directory $6. Be sure to also change the group to your own. You can find your own primary group using the "id" command.



7.

a) Use symbolic notation to add execute permissions for just yourself to file $7.

b) Execute $7 using just its path (no "bash" or "python" or anything needed).

c) cd to $7's directory.

d) Execute $7 using dot-slash notation.

e) cd back to where we where. (cd with a dash or pushd/popd would be useful here...)



8. Use octal notation to recursively set the permissions of directory $8 to "755".



9. Add execute permissions to just "others" for all files in $9 that end in ".sh".



10. Add the execute bit recursively for all users (owner, group, and other) to all DIRECTORIES (not files!) in $10. (hint: how can you make globstar look only at directories?).



11. Run the top command for 3 iterations.



12. Print PIDs of all processes belong to the user "syslog".



13. Pipe the output of "ps aux" or "ps -eHwf" to grep to search for all lines containing "sshd".



14. Print PIDs of all processes containing "sshd".



15. Run "ps aux" modified in such a way as to print the most memory hungry processes at the top.



16. Echo a command that would run $11 as a super user.

Прошло времени с момента публикации: 8 лет 2 месяца 19 дней 13 часов 0 минут
Раздел: Программирование

Наши партнеры
Сведения об ООО «Ваан» внесены в реестр аккредитованных организаций, осуществляющих деятельность в области информационных технологий. ООО «Ваан» осуществляет деятельность, связанную с использованием информационных технологий, по разработке компьютерного программного обеспечения, предоставлению доступа к программе для ЭВМ и является правообладателем программы для ЭВМ «Платформа FL.ru (версия 2.0)».