Попробуйте этот. Измените команду «echo» на cp или mv после тестирования:
for f in samples.txt ; do
echo /source/path/*$(cut -d '|' -f 5,2 $f | tr '|'a-z '_'A-Z)*.pdf /destination/path
done
Прости, мой плохой. Спасибо @Kusalananda. Пожалуйста, считайте приведенный выше ответ неправильным и попробуйте этот. Предположим, вы фильтруете по 5 -и 4 -столбцам, он копирует файлы из /src в /dst :
.awk -F "|" '{system("cp /src/*"toupper($5)"_"$4"*.pdf /dst")}' samples.txt
Вы можете просматривать огромные .gz
файлы с помощью zless
. Со страницы руководства:
Zless is a filter which allows examination of compressed or plain text files one screenful at a time on a soft-copy terminal. It is the equivalent of setting the environment variable LESSOPEN to '|gzip -cdfq -- %s', and the environment variable LESSMETACHARS to ';*?"()<>[|&^`#\$%=~', and then running less. However, enough people seem to think that having the command zless available is important to be worth providing it.