А знаете ли вы, что в 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
📰Intel's Cache Aware Scheduling Inches Closer To Being Merged For Linux
I have been writing about the Cache Aware Scheduling work led by Intel engineers on the Linux kernel for more than a year. I've also tested out Cache Aware Scheduling on both Intel and AMD CPUs with the patched Linux kernel to great success. And thus very happy to see the Cache Aware Scheduling patches inching closer to the mainline Linux kernel...
🔗 Source: https://www.phoronix.com/news/Linux-Cache-Aware-Sched-Nears
#amd#intel#kernel#linux
📰 Linux Scheduler Work Helping Boost Gaming Performance On Old "Potato" Hardware
Prominent Linux kernel engineer Peter Zijlstra of Intel has been working on a set of scheduler patches to help with enhancing the behavior and delivering better results, especially for aging hardware he described as a "potato" -- an Intel Sandy Bridge desktop CPU with AMD Radeon RX 580 Polaris graphics. Benchmark results are promising from this work for gaming on old hardware while other workloads may ultimately stand to benefit too...
🔗 Source: https://www.phoronix.com/news/Linux-Flatten-The-Pick
#amd#intel#kernel#linux
📰 Linux Drivers For The AMD Elan SoCs From The 1990s On Track For Retirement
Merged for the current Linux 7.1 cycle was beginning to phase out the Intel 486 processor support from the mainline kernel moving forward. That initial step with Linux 7.1 was dropping the various Kconfig options to allow compiling Linux kernel builds for targeting various i486 platforms. As part of that, the AMD Elan SoC configuration patches were dropped.
🔗 Source: https://www.phoronix.com/news/AMD-Elan-Linux-Driver-Removal
#amd#intel#kernel#linux
📰Many Wonderful Improvements Expected For Linux 7.1, Especially For AMD & Intel
With Linux 7.0 expected for release later today, in turn the Linux 7.1 merge window will kick off for the two week period of landing all sorts of exciting new features, changes, and removal of old features from the kernel. Here is a look at some of what is on the table for the Linux 7.1 merge window...
🔗 Source: https://www.phoronix.com/news/Linux-7.1-Features-Early-Look
#amd#intel#kernel#linux
📰Reverse Engineering Linux Distro REMnux Marks 15 Years With Major v8 Release Featuring AI Agent Support
Malware analysis Linux distro gets Ubuntu 24.04 base, a new installer, and many new tools.
🔗 Source: https://itsfoss.com/news/remnux-v8-release/
#distro#linux#ubuntu
https://www.linux.com/learn/intro-to-linux/2017/11/5-coolest-linux-terminal-emulators
5 Coolest #Linux Terminal Emulators
Sure, we can get by with boring old GNOME terminal, Konsole, and funny, rickety, old xterm. When you're in the mood to try something new, however, take a look at these five cool and useful Linux terminals.
#Xiki: http://bit.ly/2i8y7Jm
#Cool_Retro_Term: http://bit.ly/1tC7gBP
#Sakura: https://bugs.launchpad.net/sakura
#Terminology: https://www.enlightenment.org/about-terminology
#Tilda: https://github.com/lanoxx/tilda
👩💻101 ta Linux buyruqlari — CheatSheet (Kitob)
Linux terminalini o‘rganmoqchimisiz? Yoki siz allaqachon tajribali foydalanuvchimisiz? Unda quyidagi CheatSheet siz uchun!
Ushbu material yordamida siz quyidagilarni o‘rganasiz:
• Basics;
- File Hierarchy Standard (FHS);
- Commands;
• Disk and File System Management;
- General Disk Manipulation (non-LVM);
- Globs (Wildcards);
- Regex;
- Stream redirection;
• Text Readers & Editors;
- Less;
- VI;
• User and Group Management;
• File System Permissions;
• SSH;
• Cronjobs;
• Package Management;
- RPM;
- YUM;
• List of commands by category:
- Directory Navigation;
- File Commands;
- File and Directory Manipulation;
- Package archive and compression tools;
- System commands;
- Networking Commands;
- Package Management;
- User Information commands;
- Session commands;
- Getting Help;
- Applications.
🔗To‘liq material:
https://github.com/bobbyiliev/101-linux-commands-ebook
📌 Kitob ham yangi boshlovchilar, ham tajribali sysadminlar uchun foydalidir. Har bir bo‘lim aniq misollar bilan yoritilgan.
#Linux#Terminal#Buyruqlar#LinuxCommands#CheatSheet#OpenSource
💻@dasturlash_hayoti — bir xatoni tuzatib, ikkinchisiga tayyorlanish! 😅
📰Running Four Intel Graphics Cards Under Linux On Ubuntu 26.04
It's been nearly one year to the week since Intel introduced Project Battlematrix as their initiative for improving their Linux driver support for the Arc Pro B-Series with enhancements such as bettering the multi-GPU support in allowing up to eight Arc Pro GPUs per system as well as other open-source driver optimizations in the era of AI.
🔗 Source: https://www.phoronix.com/review/intel-arc-pro-b70-four
#intel#linux#opensource#ubuntu
#python#language_models#linux#machine_translation#nlp#open_source#python#transformers#translation
Argos Translate is a free, open-source tool that lets you translate text offline using your own computer. It works as a Python library, command-line tool, or with a graphical interface, and supports many languages. You can install language packages for direct translations, and it can even translate between languages that don’t have a direct package by using a middle language. This means you can translate more language pairs, though the quality might be a little lower. Argos Translate is fast, private, and does not need an internet connection after setup, making it useful for secure or offline translation needs.
https://github.com/argosopentech/argos-translate