создайте функцию в вашем файле .bashrc или .zshrc, который находится в вашем домашнем каталоге.
Добавьте в конец файла следующее:
cd_fetch() {
command cd "$@"
if [ -d .git ]; then
git fetch &
fi
}
alias cdg=cd_fetch
Теперь закройте и снова откройте ваш терминал или запустите source ~ / .zshrc
, и теперь вы можете изменить каталог с помощью команды cdg
, которому вы присвоили псевдоним.
Также, если вы не хотите использовать cdg
и хотите использовать только cd
, измените определение псевдонима на alias cd = cd_fetch
.
Этот подход по-прежнему выводит все, что обычно делает git fetch, чтобы отключить его, заменив строку git fetch &
на git fetch 2> & 1> / dev / null &
.
ps2pdf input.pdf output.pdf
Я получил ответ от ask ubuntu , и это сработало для меня. На самом деле он уменьшил 18,1 МБ до 1,0 МБ
.Вы можете попробовать это:
$ time pdftk myFile.pdf output myFile__SMALLER.pdf compress
GC Warning: Repeated allocation of very large block (appr. size 16764928):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 8384512):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 11837440):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 8384512):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 33525760):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 7254016):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 34041856):
May lead to memory leak and poor performance.
GC Warning: Repeated allocation of very large block (appr. size 33525760):
May lead to memory leak and poor performance.
real 0m23.677s
user 0m23.142s
sys 0m0.540s
$ du myFile*.pdf
108M myFile.pdf
74M myFile__SMALLER.pdf
Это быстрее, чем gs
, но в этом случае сжатие до 30% для входного файла размером 107,5 МБ.