Activity for r~~
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Comment | Post #292980 |
Just to make sure, you do know that the output of the `h` command (and other commands with outputs) goes to the kernel log and not your current terminal, right? You need to run `dmesg` to see it. (more) |
— | 5 days ago |
Edit | Post #291650 | Initial revision | — | 6 months ago |
Answer | — |
A: How do I send console output to the clipboard? On Wayland, the `wl-clipboard` utility `wl-copy` is the program you want: ``` echo hi | wl-copy ``` (more) |
— | 6 months ago |
Comment | Post #285187 |
Pick one, get corrected if necessary. (more) |
— | 6 months ago |
Edit | Post #291146 | Initial revision | — | 8 months ago |
Answer | — |
A: How do you generate arbitrary random numbers from /dev/random? You want `shuf`. ```sh shuf -n1 -i 534-876874 ``` (more) |
— | 8 months ago |
Edit | Post #291145 | Initial revision | — | 8 months ago |
Answer | — |
A: What is cat abuse/useless use of cat? Especially in a pedagogical context, the issue with something like `cat /dev/random | head -c 20` versus the more straightforward `head -c 20 /dev/random` is that it communicates that extra ceremony is necessary. It isn't. Using one program instead of two isn't about saving kilobytes of computer memo... (more) |
— | 8 months ago |
Comment | Post #291137 |
`<file1 | grep cookies | wc` might work in your shell of choice but it doesn't work in Bash.
I look forward to your mocking rant about people who point out that other shells exist. (more) |
— | 8 months ago |
Comment | Post #290827 |
The answer says, ‘`sudo ls ~` [prints] the contents of your actual home directory [...] This is because [...] `sudo` [...] does not change your `$HOME`’. This is doubly false, as I explained—`sudo` can change `$HOME`, and the behavior of `sudo ls ~` doesn't depend on whether or not it does. (more) |
— | 9 months ago |
Edit | Post #290837 |
Post edited: |
— | 9 months ago |
Edit | Post #290837 | Initial revision | — | 9 months ago |
Answer | — |
A: How to use the gitignore file without git(1). You can fake out `git` as long as you have some empty Git repository available somewhere. ``` git --git-dir=path-to-empty-repo/.git \ ls-files --others --exclude-standard ``` (more) |
— | 9 months ago |
Comment | Post #290827 |
`sudo ls ~` will not tell you whether `sudo` sets `HOME`, because the `~` is expanded by the non-root user's shell. In many distributions, `sudo` *is* configured to set `HOME` by default. There are several configuration options that determine whether `sudo` modifies `HOME` or other environment variab... (more) |
— | 9 months ago |
Edit | Post #290797 |
Post edited: cat isn't needed |
— | 9 months ago |
Suggested Edit | Post #290797 |
Suggested edit: cat isn't needed (more) |
helpful | 9 months ago |
Comment | Post #290716 |
Have you read what sudo does? If so, it's not clear what you want to know. If not, this is insufficient research for a question here. (more) |
— | 10 months ago |
Comment | Post #290201 |
On Debian Trixie, if you have the `console-setup-linux` package installed, [the files in that package](https://packages.debian.org/trixie/all/console-setup-linux/filelist) include terminal fonts of sizes up to 16x32.
And yes, the character grid is changed, not just the glyph sizes. A 16x32 font wo... (more) |
— | about 1 year ago |
Edit | Post #290201 | Initial revision | — | about 1 year ago |
Answer | — |
A: How to change resolution of virtual terminal? This isn't exactly what you asked, but the letters-too-small problem could also be solved by using a larger console font. Here is a decent overview of how to change console fonts, though I don't know which of the `console-setup` and the `vconsole.conf` approaches is correct for your distribution. (more) |
— | about 1 year ago |
Edit | Post #290012 |
Post edited: |
— | about 1 year ago |
Edit | Post #290012 |
Post edited: |
— | about 1 year ago |
Edit | Post #290012 | Initial revision | — | about 1 year ago |
Answer | — |
A: Rename multiple files which have a variable suffix An easy one-liner in POSIX-compatible shells: ``` for f in -min.jpg-; do mv -- "$f" "${f%-}"; done ``` The only (mildly) tricky concept here is `${f%-}`, which expands to `$f` minus the shortest suffix matching the glob pattern `-`. (more) |
— | about 1 year ago |
Edit | Post #289874 |
Post edited: |
— | about 1 year ago |
Comment | Post #289874 |
That is a really good catch, thanks. (more) |
— | about 1 year ago |
Comment | Post #289874 |
Piping is a shell feature. If you want to use shell features, you have to be running in a shell. The `find` manual isn't responsible for pointing that out.
[It is specified](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13_03) that wildcards in shell scripts must... (more) |
— | about 1 year ago |
Comment | Post #289874 |
The `\! -empty` is there because if the shell expands a wildcard that doesn't match anything, the wildcard remains, and you don't want `.../empty_dir/*` in your output.
The `ls` is an unnecessary subprocess invocation. `sh` is already expanding the `*` before `ls` is invoked. (more) |
— | about 1 year ago |
Comment | Post #289875 |
Fair, post edited. (more) |
— | about 1 year ago |
Edit | Post #289875 |
Post edited: |
— | about 1 year ago |
Edit | Post #289875 | Initial revision | — | about 1 year ago |
Answer | — |
A: How to overwrite each line of STDOUT with the next one? In Bash, you could use the `$COLUMNS` environment variable to detect the width of your terminal and truncate each line to that length in your sed script. Something like this should work: ``` sed "s/^\(.\{,$COLUMNS\}\).$/\1/;2,\$s/^/\x1B[1A\x1B[K/" ``` For a sh-compatible alternative, replace ... (more) |
— | about 1 year ago |
Edit | Post #289874 | Initial revision | — | about 1 year ago |
Answer | — |
A: How to list the first x files in each directory Is this what you want? Edit: Credit to Kamil Maciorowski for catching an unsafe interpolation in the previous draft; it will work for non-adversarial inputs but this newer version is safer and a better example to learn from. ```sh find l1 -mindepth 2 -maxdepth 2 \ -type d \! -empty \ -... (more) |
— | about 1 year ago |
Edit | Post #289798 | Initial revision | — | about 1 year ago |
Answer | — |
A: How does the root user locate executables? > but it clearly does see that change. Nope. Your environment is being reloaded in the `sudo` process. `sudo echo $PATH` gives the same result as `echo $PATH` because `$PATH` is expanded by your shell first thing, before `sudo` gets spawned. If you want to see the value of `PATH` from inside `s... (more) |
— | about 1 year ago |
Edit | Post #289755 | Initial revision | — | about 1 year ago |
Answer | — |
A: Why does $XDG_DATA_HOME default to ~/.local/share? I wasn't there two decades ago when the spec was first being developed, but based on other parts of the spec they're clearly attempting to establish a parallel with `/usr/local`. The intended minimal `PATH=/.local/bin:/usr/local/bin:/usr/bin:/bin`; `XDGDATAHOME` and `XDGDATADIRS` form a similar order... (more) |
— | about 1 year ago |
Edit | Post #289659 |
Post edited: |
— | about 1 year ago |
Edit | Post #289659 |
Post edited: |
— | about 1 year ago |
Edit | Post #289659 | Initial revision | — | about 1 year ago |
Answer | — |
A: Are NixOS and Guix analogous projects? They are broadly analogous; there's a lot of cross-pollination of ideas between the projects. Some terminology first, because you'll notice that both columns have duplicate entries and this often confuses the conversation. | Component | in Nix | in Guix | | - | - | - | | package expression la... (more) |
— | about 1 year ago |
Edit | Post #289607 | Initial revision | — | about 1 year ago |
Answer | — |
A: Documentation for double asterisk glob expansion The pattern is an extension to, not a part of, the POSIX glob syntax. While it has emerged as an informal standard, AFAIK there is no single standard to reference to describe what it does. This means you'll need to consult the documentation for each application that uses it. For .gitignore fi... (more) |
— | about 1 year ago |
Edit | Post #289511 | Initial revision | — | about 1 year ago |
Answer | — |
A: Run a command *later* Using systemd timers is too much work? Not with `systemd-run`! ``` systemd-run --user --on-active=10min somecmd ``` (more) |
— | about 1 year ago |
Edit | Post #289494 |
Post edited: |
— | over 1 year ago |
Edit | Post #289494 | Initial revision | — | over 1 year ago |
Answer | — |
A: Ergonomic way to search man pages Unix systems are made out of many small tools that focus on specific tasks but are general enough that the investment made in learning their specific switches and hotkeys pays off over many applications. In that spirit, I would encourage you to get to know `less` better. It's not a tool specifical... (more) |
— | over 1 year ago |
Comment | Post #289489 |
> Ripgrep for example has a great way of handling cases. If query is all lower case, it does case insensitive. If it has upper case chars, it is case sensitive. You can also force case sensitive with a switch.
Have you tried this in less? I see the exact same behavior. They even use the same flag ... (more) |
— | over 1 year ago |