r_bash | Unsorted

Telegram-канал r_bash - r_bash

46

Credits: @r_channels & @reddit2telegram

Subscribe to a channel

r_bash

Writing to Input Buffer?
https://redd.it/1tppo3l
@r_bash

Читать полностью…

r_bash

Android AI screen sharing helped me learn Linux/Termux a LOT — can I do the same on Windows laptop?

I am starting to learn Linux, Git commands on Android using Termux, and the live screen sharing feature with ChatGPT / Gemini was very useful.

Tjey viewed my screen and corrected my errors etc. Felt like a tutor I never had.

Anyone else online I ask to be a mentor is either super busy or they don't understand how to talk to a total noob like me. Anyway no one else has tjat kind of time.

Now I’m moving more of my learning to my Windows Terminal.. Installed WLS.

Can this same be done on laptop ?

I checked chatgpt app on my laptop, it doesn't show same live screen sharing feature.

Any other workaround?

I just want it to view the screen, should not be able to do anything on the screen or perform anytask itself. Just guide me through voice amd chat.

Is it possible? Any workaround?

https://redd.it/1tozzkp
@r_bash

Читать полностью…

r_bash

Built a terminal-native context extraction workflow for large repositories

i Built a small terminal tool called `grab` for debugging large repositories with ChatGPT/Claude.gi

The main issue I kept running into was context fragmentation.

You search across 10–15 files, paste partial snippets into the model, lose surrounding logic, and eventually the model starts hallucinating missing implementation details.

`grab` turns that into a more structured workflow:

grab --tree
grab auth
grab --functions server.py
grab 500 635 auth.cs


Each extraction appends into a continuously accumulated clipboard/tmux context buffer.

One thing that ended up working surprisingly well was recursive function indexing:

grab --functions .


This exposes exact function boundaries and line ranges, so the model can request additional implementation context explicitly instead of guessing hidden code paths.

The workflow becomes more like:

search → extract → accumulate → recurse


instead of repeatedly copy-pasting disconnected snippets.

Built on top of:

* ripgrep
* sed
* clipboard/tmux workflows

Currently supports:

* Python
* C#
* JS/TS
* shell repositories

Would genuinely be interested in feedback from people debugging large repositories with ChatGPT/Claude or similar tools.

Repo:
[https://github.com/johnsellin93/grab](https://github.com/johnsellin93/grab)

https://redd.it/1tng3vs
@r_bash

Читать полностью…

r_bash

A Vd



View Poll

https://redd.it/1tn65xc
@r_bash

Читать полностью…

r_bash

A shell wrapper to isolate claude code inside docker (with dmenu/fzf)

As a archlinux, and suckless philosophy enjoyer, I wanted to try out Anthropic's claude code cli, but I really didn't like the idea of installing it as a global npm package and giving an AI agent full access to my host filesystem.

Full disclosure: I wrote this script myself for my personal workflow (integrated with my window manager), and wanted to share it here to see if anyone finds it useful.

It's a lightweight, POSIX-compliant script (#!/bin/sh) that handles the entire container lifecycle, dynamically maps host uid/gid during the build step, and uses dmenu and fzf for mode and directory selection.

The repository with the full script can be found here: https://github.com/shirozuki/claude-cli

I would love to get your general feedback on the script, the approach, or any improvements you might suggest. Thanks!

https://redd.it/1tlrrxu
@r_bash

Читать полностью…

r_bash

USEKIT — a small Python toolkit/editor workflow for Termux



https://redd.it/1tl1zkd
@r_bash

Читать полностью…

r_bash

Install jargon file as man page
https://github.com/smithbh/jargon-mandoc/

https://redd.it/1tkofqx
@r_bash

Читать полностью…

r_bash

My personal roadmap for linux foundation .
https://redd.it/1tkggv6
@r_bash

Читать полностью…

r_bash

Here are mine, what aliases does others swear by?

Wrote up a collection of shell aliases that have quietly saved me a lot of time over the years. The kind of thing you set up once and wonder how you lived without.

A few from the article:

alias gs='git status'

alias ..='cd ..'

alias ll='ls -lah'

alias grep='grep --color=auto'

alias ports='ss -tulanp'


Covers aliases for navigation, git shortcuts, file operations, and a few that are specific to dev workflows.

Full list here: https://medium.com/stackademic/shell-aliases-that-will-save-you-hours-every-week-42523ef08064?sk=4905d8b510832dad699810b1ce6322b0

Curious what aliases the folks here swear by. drop yours in the comments.

https://redd.it/1tjsqdv
@r_bash

Читать полностью…

r_bash

bind -x '"...": setsid kill -2 $$' works but bind -x '"...": kill -2 $$' does not

I'm stumbling over a behavior in bash that I don't 100% understand. The following doesn't work as expected:

bind -x '"\ex": kill -SIGINT $$'

I would expect this to behave pretty much identical to pressing Ctrl-C, which in a normal terminal in canonical mode would send a SIGINT to the foreground process group of the session associated with the controlling terminal, which is in the case of readline in bash is handled by an appropriate signal handler that aborts the current readline buffer and reprints the prompt. Because of stty echoctl, we should also see a ^C being printed by the terminal itself.

However, this is not what happens. Instead, when I type \ex (Alt-x or Meta-x), it deletes the current PS1 prompt string, does NOT print ^C, moves to a new line, and then prints a new PS1 prompt string. Visually, it looks like the current line was completely (basically what printf '\033[2K' would do)) and then a new line is created. Running it multiple times creates a lot of empty whitespace. Functionally, it's identical to Ctrl-C, though, which makes sense.

The weird thing is, if I run the kill -SIGINT command from another terminal, OR I adjust the command to be setsid kill instead of just kill (I know that this calls /bin/kill instead of the bash builtin kill, but that's irrelevant to the matter), then it suddenly works exactly as expected, identical to pressing Ctrl-C.

Can someone explain exactly what is going on? Adding stty sane or stty echo echoctl before the kill didn't help, unfortunately. My guess is that in the "bind -x" execution context, the terminal characteristics are set to -echo -echoctl (and maybe some more), but then why doesn't stty sane/stty echo echoctl help it?


https://redd.it/1tjez3m
@r_bash

Читать полностью…

r_bash

Flyline: a Bash plugin to replace readline for a modern line editing experience
https://github.com/HalFrgrd/flyline

https://redd.it/1ti19i8
@r_bash

Читать полностью…

r_bash

How to create crontab/cronjob through a script?

I want to add a cronjob entry programmatically through the script instead to manually adding the entry in crontab -e.

Suppose, i have a script that runs to check for ram usage, and I want to add a cronjob inside the same script and run it every 5 mins. Is it possible to do so?

https://redd.it/1thtbip
@r_bash

Читать полностью…

r_bash

Run windows apps on linux?
https://redd.it/1thjj9o
@r_bash

Читать полностью…

r_bash

I built a tool that turns daily hacking practice into a streak habit. Red/Blue/Purple Team paths, real code drills.
https://hacklingo.tech

https://redd.it/1th3dzx
@r_bash

Читать полностью…

r_bash

Linux basics command lines
https://redd.it/1tgaapl
@r_bash

Читать полностью…

r_bash

sharing a folder of markdown with someone who doesnt want to unzip anything

ok so i had this dumb problem. got a folder with like 4 markdown files (readme, sources, conventions file) i wanted to hand to someone on my team. the options were zip it, paste each file one by one, or throw it in a gist.

none felt right for 3kb of text. zip is overkill, gist splits it into one file per url, pasting loses the directory structure entirely.

wrote a thing that packs a directory into one self-describing markdown file. fold ./my-notes gives you my-notes.folded.md. recipient runs unfold my-notes.folded.md and gets the directory back. bash, no deps. the folded file is plain markdown with section delimiters so you can read it in a browser or text editor without unfolding, kinda like a human-readable shar.

(full disclosure: my project, fold.dom.vin)

mainly wondering if anyone else hits this specific annoyance and what you use. i know shar exists but wanted something you can actually read as-is without running it.

https://redd.it/1tpdr5t
@r_bash

Читать полностью…

r_bash

grep: Piping command output into grep -f <pattern file> isn't working

Hey everyone, hope you're having a nice day.

I have 4 files (A-D) and a text file (T) in a directory. T contains the MD5 checksums of A-D on individual lines output directly from md5sum, i.e. the form <checksum> <file>, as well as a bunch of other lines. I want to take the MD5 checksums of A-D and check that they match the ones in T.

The command I've come up with is md5sum <directory>/* | grep -f T. This command takes the checksums of A-D and T, then gives it to grep to see if they match the checksums in T. However, the standard output I am getting from this command is the checksums of A-D and T, but T doesn't contain its own checksum, so why is this happening? Curiously, the lines output from the command aren't highlighted, if I do a test grep, the matching characters appear in bold red, but these lines appear as standard white characters.

Thanks!

https://redd.it/1tom2wc
@r_bash

Читать полностью…

r_bash

Minimalist natural language to shell command assistant
https://github.com/Omodaka9375/ai-in-a-shell

https://redd.it/1tnc55h
@r_bash

Читать полностью…

r_bash

PDF Toolbox



https://redd.it/1tn333j
@r_bash

Читать полностью…

r_bash

noob Is there a way to refactor this simple "additional args"?

notify() {
local -a args
if [ "$target" != pixel ]; then
args=(--icon="$file" "$@")
else
args=("$@")
fi
notify-send --hint=string:x-dunst-stack-tag:shot \
--hint=string:synchronous:shot --app-name=screenshot "${args@}"
}

args=("$@") is not great, but neither is referencing notify-send twice when it's the same command with an optional --icon="$file". There's parameter expansion :+ but it replaces it with an empty string so would need an eval(?). Turning notify-send into a nested function is a bit verbose.

This logic is something I do often so wondering if this is as good as it gets.

https://redd.it/1tl5kb5
@r_bash

Читать полностью…

r_bash

What would you call this? IO stream question

OK, so I'm a long-time hobbyist, no training or professional experience. I don't really know what I'm asking for here, so I'm just going to describe it and maybe somebody can point me in the right direction.


When scripting a bunch of binaries and shell commands together to automate stuff, it's very common for me to redirect Stdout and Stderr to some temporary log files, and then "tail -f | grep" the logs in a separate session, as a status monitor. (Headless server, so everything's over ssh)

This works great, except that you have to actually issue the tail command somewhere, and then leave it running. This means 2 or 3 tabs in the Mobaxterm window, for any given thing I'm doing. So I have to check back every so often, to see if anything's gone fucky.

I've used "wall" to send notices to any open terminals, which is really close. But only works if I'm at my desk, with Mobax/Putty open and visible.

I'm imagining REALLY OLD systems, where a dot matrix line printer was used for this, to keep the terminal freed up, and only spit out info that mattered- even the sound those things made, was kind of an alert to tell you that you needed to go look. What would be the modern equivalent?

If I had a screen, either a spare monitor or even one of those little 5" USB monitors, that I could stick on the side of the server rack, and redirect individual lines to, then I'd have a dedicated place for those notifications to be sent to. If the screen isn't blank, it means I need to read what it says. Easy. Instead of Stdout or Stderr, it would be some third thing that works equivalently for redirects.

How could I do this?

Or am I overlooking something real obvious that would make this whole idea unnecessary? Which is completely possible.

https://redd.it/1tl1ora
@r_bash

Читать полностью…

r_bash

Linux and Shell Scripting Notes
https://www.reddit.com/gallery/1tkl96d

https://redd.it/1tkly5m
@r_bash

Читать полностью…

r_bash

Silly little trivia / "joke" / headcanon: found evidence that Steve Bourne is actually rebourne-again Lord Kelvin

Ohm (Ω) is the unit of electrical resistance. What should the reciprocal "opposite" electrical conductance be called? "Obviously mho (℧)", said Lord Kelvin.

From Wikipedia: Siemens (unit of conductance)#Mho)

100 years (or something) later someone asks how IF and CASE clauses should be terminated...

Coincidence??

(tbh Bourne just adopted these "if-fis" and "case-esacs" to Bourne shell from ALGOL 68, but he also worked on that so I stubbournely choose to believe he's still the progenitor of the idiom.)

https://redd.it/1tk273z
@r_bash

Читать полностью…

r_bash

Over ssh, sudo reboot; logout is not always working as expected. Why?

When working over ssh, I sometimes want to reboot or power off a system. The usual error message about the broken pipe annoy me, so I use

`sudo reboot; logout` as a stop for it. The interesting issue is that it doesn't work on all systems. A sixth gen Intel NUC works, but on an 11th gen Intel CPU I get the same errors as if I didn't issue the logout:

Broadcast message from root@NUC11TNKi3 on pts/1 (Thu 2026-05-21 11:38:21 CEST):

The system will power off now!

Read from remote host nuc11tnki3.lan: Connection reset by peer
Connection to nuc11tnki3.lan closed.
client_loop: send disconnect: Broken pipe

On a 10th gen Intel NUC, it's no issue:

`sudo reboot; logout`

Broadcast message from root@nuc10i3fnk on pts/2 (Thu 2026-05-21 11:58:15 CEST):

The system will reboot now!

Connection to nuc10i3fnk.lan closed.

It should have something to do with the timing (that's why I post it in /r/bash), but I can't identify why only *some* systems show it. I use it on some fast systems and on slow systems without problems. Bash version is 5.3.9 in case it plays a role. But I have used other systems with other bash versions as well.

https://redd.it/1tjfnfo
@r_bash

Читать полностью…

r_bash

Made a ffmpeg video converter to H.265 script to save space on my video files
https://redd.it/1tieb2m
@r_bash

Читать полностью…

r_bash

Removed by Reddit

Removed by Reddit on account of violating the [content policy. ]

https://redd.it/1thx4o2
@r_bash

Читать полностью…

r_bash

tadam - a one-liner that brings the Windows "TA-DAAAM!" sound back as a shell command
/r/commandline/comments/1thjo2y/tadam_a_oneliner_that_brings_the_windows_tadaaam/

https://redd.it/1thjt2z
@r_bash

Читать полностью…

r_bash

Made a shell greeter that generates a unique rocket every time you open a terminal tab

https://redd.it/1th6kg2
@r_bash

Читать полностью…

r_bash

fast alternative to find for finding git directories

Hey,

I have a small script to switch between projects. All my projects are in a deeply nested directory that is equal to their upstream source (eg. ~/projects/github.com/junegunn/fzf/).

It works by using find to enumerate all directories under ~/projects/ that contain a .git/ directory and passes that to fzf. Unfortunately this is pretty slow somehow because findtakes a long time. When using fzf directly it's super fast, but I can't restrict the selection to only include git root directories.

Is there a better way of getting a similar result? All I want is to have a fast way of switching between projects

dev () {
project="$(find $HOME/projects -type d -name .git -prune -exec sh -c 'dirname $(realpath --relative-to $HOME/projects {})' \; 2>/dev/null | fzf -1)"
if [ $? -ne 0 ]
then
return $?
fi
projectDir="$HOME/projects/$project"
pushd $projectDir
}

https://redd.it/1tglx1c
@r_bash

Читать полностью…

r_bash

There were too many scattered wrapper functions in my .bashrc. So I built Monkeypatsh
https://redd.it/1tfvp2j
@r_bash

Читать полностью…
Subscribe to a channel