Из справочной страницы less:
If a command line option begins with +, the remainder of that option is taken to be an initial command to less. For example, +G tells less to start at the end of the file rather than the beginning, and +/xyz tells it to start at the first occurrence of "xyz" in the file. As a special case, + acts like +g; that is, it starts the display at the specified line number (however, see the caveat under the "g" command above). If the option starts with ++, the initial command applies to every file being viewed, not just the first one. The + command described previously may also be used to set (or change) an initial command for every file.
Я не думаю, что вы можете сделать это напрямую, но вы можете запустить, например.
# bash; sync; halt
из первой оболочки (PID 1 )для запуска другой оболочки и для запуска sync
и halt
при выходе из этой второй оболочки.
Если вы можете редактировать файлы в системе, вы, вероятно, могли бы автоматизировать это, поместив скрипт, делающий то же самое в/sbin/init
:
#/bin/sh
/bin/bash; /bin/sync; /sbin/halt
(Я говорю «вероятно», потому что не уверен, что Linux любит скрипт в качестве инициализации.)
В обоих случаях оболочка, которую вы на самом деле будете использовать, не будет иметь PID 1, но это, вероятно, не имеет большого значения.