А знаете ли вы, что в Bash есть особая переменная "$_" ? Из описания можно узнать, что в переменную "$_" помещается последний аргумент последней команды.
Что-то знакомое? Конечно, в Python есть примерно тоже самое.
Мы знаем, что дата первого релиза Bash (8 июня 1989) несколько раньше чем первый релиз Python (20 февраля 1991). Если учесть, что по задумке автора Python это агрегация самых успешных практик отовсюду, можно ли сказать что именно эта фишка к нему пришла из Bash? Ни подтверждения ни опровержения я пока не нашел.
Давайте просто считать это совпадением 😉
А как это может быть полезно в Bash?
Приведу простой пример, который оценят те, кто часто работает в терминале.
Допустим, нам надо создать директорию и зайти в неё. Что обычно делаем?
:~$ mkdir foldername
:~$ cd foldername
:~/foldername$
Как это сделать в одну команду?
:~$ mkdir foldername && cd foldername
:~/foldername$
Уже лучше, но хочется короче, без повторов. Вот тут и пригодится наша переменная. Напомню, что в неё сохраняется последний аргумент предыдущей команды.
:~$ mkdir foldername && cd $_
:~/foldername$
_________________
PS.
Символы "&&"" разделяют команды и означают, что требуется выполнить вторую команду только если первая завершилась успешно.
#linux#tricks
💻DevOps va IT bo‘yicha muhim qo‘llanma to‘plami!
🚀 Muhim mavzular bo‘yicha tezkor va qulay cheat-sheet (shpargalkalar) to‘plami. DevOps va IT mutaxassislari uchun juda foydali!
📌Ichiga oladi:
— Nginx
— Docker
— Ansible
— Python
— Go (Golang)
— Git
— Regular Expression (Regex)
— PowerShell
— VIM
— Jenkins
— CI/CD (Continuous Integration & Continuous Delivery)
— Kubernetes
— Linux
— Redis
— Slack
— Puppet
— Google Cloud Developer
— PostgreSQL
— Ajax
— Amazon Web Services (AWS)
📥Bepul yuklab olish...
#CheatSheet#DevOps#IT#Linux#Docker#Kubernetes
💻@dasturlash_hayoti — bir xatoni tuzatib, ikkinchisiga tayyorlanish! 😅
#typescript#docker#docker_compose#linux#rdp#virtualization#windows
WinBoat lets you run any Windows app on Linux with a smooth, native-like experience by running a full Windows system inside a Docker container using virtualization. It has an elegant interface and automates installation, so you just pick your settings and it handles the rest. You can run individual Windows apps seamlessly alongside Linux apps or access the full Windows desktop when needed. Your Linux files are easily shared with Windows, making file management simple. This helps you use Windows-only software on Linux without complicated setups, though it requires some system resources and setup steps like enabling virtualization and installing Docker. WinBoat is still in beta, so occasional bugs may occur.
https://github.com/TibixDev/winboat
📰 Debian Is Figuring Out How Age Verification Laws Will Impact It
With age verification/attestation laws down to the OS level enacted by California and being decided upon by other US states, it's been a hot topic of discussion in the open-source world. For the Debian project that is strictly volunteer/community-driven unlike various commercial Linux platforms, they are figuring out how such laws will impact them...
🔗 Source: https://www.phoronix.com/news/Debian-Undecided-Age-Laws
#linux#opensource#debian
📰 Parrot OS 7.2 Ships with Linux Kernel 6.19 and Copy Fail Fix
Parrot OS 7.2 is now available with Linux kernel 6.19, updated security tools, Debian package sync, and Copy Fail mitigation.
🔗 Source: https://linuxiac.com/parrot-os-7-2-ships-with-linux-kernel-6-19-and-copy-fail-fix/
#debian#kernel#linux
📰 GParted Live 1.8.1-3 Released with Linux Kernel 6.19.10 and GParted 1.8.1
GParted Live 1.8.1-3 Debian-based live system for performing disk partitioning tasks using the GParted partition editor is now available for download with Linux kernel 6.19.
🔗 Source: https://9to5linux.com/gparted-live-1-8-1-3-released-with-linux-kernel-6-19-10-and-gparted-1-8-1
#linux#kernel#debian
📰 GParted Live 1.8.1 Released With Linux Kernel 6.19
GParted Live 1.8.1, a bootable Linux system for disk partitioning, is out with Linux kernel 6.19, Debian Sid updates, and the stable GParted 1.8.1 release.
🔗 Source: https://linuxiac.com/gparted-live-1-8-1-released-with-linux-kernel-6-19/
#kernel#linux#debian
📰 SparkyLinux 2026.03 Tiamat Released Based on Debian Testing Forky
SparkyLinux 2026.03 has been released, featuring updated Debian Testing packages, Linux kernel 6.19, and refreshed rolling ISO images.
🔗 Source: https://linuxiac.com/sparkylinux-2026-03-tiamat-released-based-on-debian-testing-forky/
#kernel#debian#linux
📰 SparkyLinux 8.2 Released with Support for Linux Kernel 6.19, Updated Packages
SparkyLinux 8.2 distribution is now available for download with support for Linux kernel 6.19, based on Debian 13 "Trixie". Here's what's new!
🔗 Source: https://9to5linux.com/sparkylinux-8-2-released-with-support-for-linux-kernel-6-19-updated-packages
#linux#debian#kernel