1 year ago
by admin
Матеріал з Вікіпедії — вільної енциклопедії.
Перейти до навігаціїПерейти до пошуку
rm (від англ. remove) — утиліта у UNIX та UNIX-подібних системах, що використовується для видалення файлів з файлової системи. Деякі ключі, що використовуються з rm:
-r
, -R
— обробляти всі вкладені підкаталоги. Цей ключ необхідний, якщо файл, що видаляється, є каталогом, нехай навіть порожнім. Якщо файл, що видаляється, не є каталогом, то ключ -r
не впливає на команду rm.-i
— виводити запит на підтвердження кожної операції видалення.-f
— не повертати код помилкового завершення, якщо помилки були викликані файлами, що не існують; не запрошувати підтвердження операцій.
rm
може бути синонімом (alias) команди rm -i
, тобто команда за умовчанням запрошує підтвердження перед видаленням файлів, що дозволяє запобігти їх випадковому видаленню. Якщо користувачеві потрібно видалити велику кількість файлів без підтвердження операції, можна скасувати дію ключа -i
за допомогою додавання ключа -f
.
Приклад використання:
rm -rf mydir
— рекурсивно видалити без підтвердження та коду помилкового завершення файл (або каталог) mydir.
Category: Linux | Comments: 0
1 year ago
by admin
Install zsh
- Install zsh in Arch Linux
sudo pacman -S zsh
- Set Zsh as default shell
chsh -s /usr/bin/zsh # for users
sudo chsh -s $(which zsh) # for root
- Log out and then login again to your terminal to use the new Zsh shell.
echo $SHELL
/usr/bin/zsh
- Install oh-my-zsh using curl
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
- Use agnoster zsh theme
Edit the ~/.zshrc file, edit this following line
ZSH_THEME="robbyrussell"
Into
ZSH_THEME="agnoster" # (this is one of the fancy ones)
# see https://github.com/ohmyzsh/ohmyzsh/wiki/Themes#agnoster
Save the file, and then open a new terminal to see the changes that we did
- Install powerlevel10k for Oh my zsh
Run this following command :
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
Now, edit the ZSH_THEME in ~/.zshrc file into :
ZSH_THEME="powerlevel10k/powerlevel10k"
Open a new terminal, and you should see the powerlevel10k theme has applied. If the p10k configuration wizard does not start automatically, you can run the configuration wizard the powerlevel10k theme with this command :
p10k configure
After you run the command above, p10k will prompt some questions, and you can choose the answer based on your personal preferences.
- Install plugins (zsh-autosuggestions and zsh-syntax-highlighting)
Download zsh-autosuggestions :
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
Download zsh-syntax-higlighting :
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
Install eza ulility:
sudo pacman -S eza
Edit ~/.zshrc file, find plugins=(git) replace plugins=(git) with :
plugins=(git zsh-autosuggestions zsh-syntax-highlighting)
alias ls="eza --level=1 --icons=always --group-directories-first --color=always --sort=extension"
Reopen your terminal, now you should be able to use the auto suggestions and syntax highlighting.
Category: Linux | Comments: 0
1 year ago
by admin
Printers
To get your printer working you will mainly need to install and setup CUPS.
If you choose the printer support option on the installer you will already have a working cups setup (for locally connected printers [usb] ) and only need to add your printer.
To install cups and an usb connected printer if you do not installed the printing option:
sudo pacman -Syu cups cups-browsed cups-filters cups-pdf system-config-printer --needed
To get full cups with support for many different printers per default. Install this packages on top of that:
sudo pacman -Syu ghostscript gsfonts foomatic-db-engine foomatic-db foomatic-db-ppds foomatic-db-nonfree foomatic-db-nonfree-ppds gutenprint foomatic-db-gutenprint-ppds --needed
For QT environments (like KDE/plasma LXQT):
sudo pacman -Syu print-manager --needed
Enable only the socket, which will listen if print-job is calling and then enable the service:
sudo systemctl enable --now cups.socket
or using the service, which will be running constantly.
sudo systemctl enable --now cups.service
Read at the bottom about finding drivers for common printers (skip Network Printers):
Find printer drivers
Driver dcp 1512e arch
https://aur.archlinux.org/packages/brother-dcp1510
Category: Linux | Comments: 0
1 year ago
by admin
Змінити назву таблиці:
ALTER TABLE post RENAME TO posts
Category: SQL | Comments: 0
1 year ago
by admin
В пошуковому рядку браузера:
chrome://flags/
Пошук -> dark ->
->Auto Dark Mode for Web Contents-> Default -> Enable
Category: Linux | Comments: 0
1 year ago
by admin
Вказані команди вимагають привілеїв root.
Команди Вимкнення
poweroff
shutdown -P 0
Перезавантаження
reboot
shutdown -r 0
Наступні команди вимагають наявності у системі пакету pm-utils
Режим очікування
pm-suspend
Режим очікування - переводить комп'ютер в режим економії енергії. Монітор вимикається, чіпи оперативної пам'яті споживають мінімум енергії для зберігання даних. Комп'ютер може швидко відновлювати вихідний стан (швидке пробудження).
Сплячий режим
pm-hibernate
Режим сну (hibernate) зберігає більше енергії. Це практично те саме, що повне апаратне виключення. Перед переходом до сплячого режиму всі дані з оперативної пам'яті зберігаються на жорсткому диску комп'ютера. Однак hibernate потребує більше часу для пробудження.
Гібридний режим
pm-suspend-hybrid
Гібридний режим - suspend+hibernate. Дані з оперативної пам'яті скидаються на жорсткий диск, як при режимі сну, проте живлення комп'ютера повністю не відключається, що дозволяє розбудити його швидше ніж при використанні режиму сну.
Протестувати – які режими підтримує обладнання:
pm-is-supported
Увімк./вимкн. режим економії енергії:
pm-powersave
Category: Linux | Comments: 0
1 year ago
by admin
Завершення роботи за допомогою SystemD
Завершити роботу та перезавантажити систему:
$ systemctl reboot
Завершити роботу та вимкнути комп'ютер (з вимкненням живлення):
$ systemctl poweroff
Перевести систему в режим очікування:
$ systemctl suspend
Перевести систему в режим сну:
$ systemctl hibernate
Перевести систему в режим гібридного сну (або suspend-to-both):
$ systemctl hybrid-sleep
Для керування живленням від імені непривілейованого користувача потрібен polkit. Якщо ви знаходитесь в локальній сесії користувача systemd-logind, і немає інших активних сесій, наведені нижче команди спрацюють і без привілеїв суперкористувача. В іншому випадку (наприклад, внаслідок того, що інший користувач увійшов до системи tty) systemd автоматично запросить у вас пароль суперкористувача.
Category: Linux | Comments: 0