Мне нужно заархивировать все файлы и подкаталоги в папке, включая те, которые начинаются с точки

Решение

https://gist.github.com/eslindsey/70bbc0080e335b38836fab09d19686d0

Этот Gist позволяет указать произвольную команду (и необязательные аргументы ), а также автоматически определяет созданное окно и размер экрана.

Концепция

chromium-browser --kiosk  &
sleep 5
wmctrl -r Chromium -b remove,fullscreen
wmctrl -r Chromium -b remove,maximized_vert,maximized_horz
wmctrl -r Chromium -e 0,0,0,3840,1080

Аргумент --kioskзаключается в том, чтобы избавиться от адресной строки и т. д. из chromium-browser. sleep— убедиться, что окно успевает появиться. Первые две строки wmctrlудаляют развернутые и полноэкранные свойства окна (, а нельзя объединить, поскольку wmctrlпозволяет удалить только «до двух свойств окна одновременно» ). Финал wmctrlфактически перемещает окно. g,x,y,w,hаргументы(gгравитация ). Разрешение 3840x1080 покрывает мои два дисплея с разрешением 1920x1080 -и -с одним браузером Chromium, работающим в режиме киоска.

Испытано на

Это работает в текущей версии Raspbian:

Raspbian Buster with desktop
Image with desktop based on Debian Buster
Version:July 2019
Release date:2019-07-10
Kernel version:4.19
Size: 1149 MB
SHA-256:6a1a5f20329e580d5161a0255b3d4163db6f56c3997e1c3b36bdd51140bd768e
1
16.09.2021, 16:47
1 ответ

Один из подходов состоит в объединении zipсfind:

$ cd the/dir/you/want/to/zip
$ find. -print | zip test -@
adding: file.txt (stored 0%)
adding:.hidden/ (stored 0%)
adding:.hidden/file2.txt (stored 0%)

Согласно инструкции

-@ file lists. If a file list is specified as -@ [Not on MacOS],
zip takes the list of input files from standard input instead
of from the command line. For example,
    zip -@ foo 
will store the files listed one per line on stdin in foo.zip.

Under Unix, this option can be used to powerful effect
in conjunction with the find (1) command.
For example, to archive all the C source files in the current directory
and its subdirectories:
    find. -name "*.[ch]" -print | zip source -@ 
(note that the pattern must be quoted to keep the shell from expanding it). 
0
16.09.2021, 18:23

Теги

Похожие вопросы