506
Set and forget (feddit.org)
submitted 11 months ago by a14o@feddit.org to c/linuxmemes@lemmy.world
top 50 comments
sorted by: hot top controversial new old
[-] tal@lemmy.today 43 points 11 months ago

You can list your aliases in bash pretty readily.

$ alias
alias emacs='emacs --no-site-file'
alias ls='ls --color=tty -v'
$
[-] Asetru@feddit.org 59 points 11 months ago

I, too, like my ls to show titty colours.

[-] tal@lemmy.today 3 points 11 months ago* (last edited 11 months ago)
$ git clone https://github.com/sharkdp/vivid.git
$ cd vivid && cargo build && cd ..
$ grep -v "^  nord" <vivid/themes/nord.yml >theme-template.yml
$ csplit theme-template.yml /^colors:/1 -f "theme-template"
$ sudo apt install cimg-dev
$ git clone https://github.com/ImageProcessing-ElectronicPublications/palette.git
$ cd palette
$ mkdir build && cd build && cmake ../ && cmake --build .
$ wget https://titis.org/uploads/posts/2022-01/1641518772_4-titis-org-p-nude-breasts-close-up-erotika-4.jpg
$ convert -crop 2298x1041+1878+1560 1641518772_4-titis-org-p-nude-breasts-close-up-erotika-4.jpg cropped.png
$ ./build/cpluspalette cropped.png 16 -k|tail -n+2|tr -s '[:cntrl:]' '\n'|sed s/^.//|awk "/.*/ {print \"  nord\"NR-1\": '\"\$0\"'\"}" >../titty-colors.txt
$ export LS_COLORS=$(../vivid/target/debug/vivid generate <(cat ../theme-template00 ../titty-colors.txt ../theme-template01))
$ clear
$ ls

Works for that too.

[-] Enzy@lemm.ee 31 points 11 months ago* (last edited 11 months ago)

I have an alias named cock and I don't remember what it does

Edit: shit

[-] seekpie@lemmy.seekpie.nohost.me 14 points 11 months ago
[-] Enzy@lemm.ee 16 points 11 months ago

You could say it gave me the opportunity for a hop

[-] photonic_sorcerer@lemmy.dbzer0.com 32 points 11 months ago

Did you remove the French language pack by chance?

load more comments (2 replies)
[-] Lazycog@sopuli.xyz 23 points 11 months ago

This is why I follow linux memes, I don't know if I have ever bumped into CTRL+R but I finally can let go of

history
[-] tal@lemmy.today 19 points 11 months ago* (last edited 11 months ago)

If you haven't used them before, there's also ! and ^.

! invokes the last command starting with the following string.

^ searches for the last command containing the first string, replaces that string with the second, and invokes that.

$ ls *.mp4
Episode_One.mp4  Episode_Two.mp4
$ !l
ls *.mp4
Episode_One.mp4  Episode_Two.mp4
$ ^mp4^mp3
ls *.mp3
music.mp3
$
[-] Lazycog@sopuli.xyz 6 points 11 months ago

I used !<index> Together with history by giving an index displayed in the history list, but did not know that you can use it like that! Also didn't know about ^

Thanks for the tips!

[-] nesc@lemmy.cafe 5 points 11 months ago

While you are at it, look up readline shortcuts.

[-] tal@lemmy.today 8 points 11 months ago* (last edited 11 months ago)

The default ones are the same as in emacs, so if you know emacs, you probably know them too, but Control-U kills (roughly equivalent to "cut" for non-emacs people) from the cursor to the beginning of the line, which emacs doesn't do; that defaults to something like M-- M-1 C-k in emacs.

If you're a vi person, you can do set -o vi and use vi functionality. Hit Esc to go into vi-style command mode.

[-] nesc@lemmy.cafe 3 points 11 months ago

In emacs it would be C-u - C-k I think.

[-] tal@lemmy.today 2 points 11 months ago

That'd be equivalent. Emacs has a number of way to input arguments to functions.

[-] nesc@lemmy.cafe 2 points 11 months ago

True, I forgot that it's possible to pass argument with M-#. 😺

load more comments (1 replies)
[-] palordrolap@fedia.io 2 points 11 months ago

You say this, but then you discover $HISTTIMEFORMAT which helps records when you last ran a command as a comment in the history file and Ctrl+R won't tell you that information.

The hard part with adopting that, though, is editing in plausible looking dates for commands that were issued before it was set up (or choosing not to and dealing with the confusion until those commands disappear off the top of the history).

load more comments (1 replies)
[-] Ephera@lemmy.ml 19 points 11 months ago

This is pretty much the biggest reason why I like fish. It automatically runs Ctrl+R as soon as you start typing and shows it as auto-completion suggestion.
You would not believe all the things past-me has run in their terminal, that I would never think to Ctrl+R. It's like the AI stuff the whole IT world rages about, except past-me has real intelligence.

[-] Shipgirlboy@sh.itjust.works 17 points 11 months ago

I just load bash.history in Kate or whatever and ctrl-f the command, copy the line, insert that in the terminal, adapt if necessary and go. Unless it's one of the last ten or so I used, then it's just ⬆️⬆️⬇️⬇️⬅️➡️⬅️➡️🅱️🅰️

[-] kernelle@0d.gs 8 points 11 months ago

history | grep

I like seeing different usages

[-] fmstrat@lemmy.nowsci.com 6 points 11 months ago

Use control r, and press control r repeatedly after the first find. It will cycle through every result.

[-] kernelle@0d.gs 2 points 11 months ago

Yeah that's what I'm trying to avoid, using grep displays all of my options at once.

[-] WhyJiffie@sh.itjust.works 4 points 11 months ago

also, put a space before history so the useless searches don't end up in the history

[-] Bo7a@lemmy.ca 2 points 11 months ago

I alias h to history | grep

[-] Xttweaponttx@sh.itjust.works 2 points 11 months ago

This is the way

load more comments (4 replies)
[-] galoisghost@aussie.zone 16 points 11 months ago

I installed atuin a while ago and never looked back

[-] hera@feddit.uk 10 points 11 months ago

Or do as I do, set up aliases for everything and forget out to use the actual commands

[-] UnityDevice@lemmy.zip 8 points 11 months ago

fzf makes ctrl-r really nice so you use it more often, especially if you use tmux as well.

[-] SchwertImStein@lemmy.dbzer0.com 3 points 11 months ago

check out atuin.sh

[-] a14o@feddit.org 2 points 11 months ago

Big fan of both fzf and tmux!

[-] Psaldorn@lemmy.world 7 points 11 months ago

Using gs, ga and gc for git bullshit has saved me many a keystroke. They show the current status, last log and prompt me for commit message and everything!

[-] 30p87@feddit.org 6 points 11 months ago

I basically exclusively use Ctrl+R. Even if I need to enter all but one characters of the command in question.

[-] lemmeBe@sh.itjust.works 6 points 11 months ago
[-] SchwertImStein@lemmy.dbzer0.com 6 points 11 months ago

use abhreviations instead of aliases, bacuase they make your history usable on any other machine

[-] InternetCitizen2@lemmy.world 4 points 11 months ago

How did you abbreviate ls?

[-] SchwertImStein@lemmy.dbzer0.com 2 points 11 months ago

l (underscore L), but it expands to eza with some flags

[-] InternetCitizen2@lemmy.world 3 points 11 months ago

I was joking, but I aslo tie it to eza lol

[-] a14o@feddit.org 3 points 11 months ago

Good advice!

[-] tal@lemmy.today 4 points 11 months ago

up arrow

If readline hasn't been reconfigured from the default emacs mode, you can use Control-P and keep your fingers on the home row.

[-] a14o@feddit.org 4 points 11 months ago

That's what I actually use (and ctrl-r also quite a bit), but up arrow for the meme

[-] rikudou@lemmings.world 4 points 11 months ago

I started using CTRL+R with McFly and now I don't use the up arrow, except if I remember it's in the last ~10 commands.

[-] GlenRambo@jlai.lu 3 points 11 months ago

Ive been using Kali in a lab lately and the terminal seems to remember commands and prefills them. How do I do Something like that in Mint?

[-] a14o@feddit.org 5 points 11 months ago

There's probably many different ways to achieve this but I would probably use a shell (zsh or fish) that does this by default

[-] cupcakezealot@lemmy.blahaj.zone 3 points 11 months ago

i like how it's' easier for me to do less ~/.bash_history | grep <some part of a command i want to us> instead of just doing an alias.

[-] crmsnbleyd@sopuli.xyz 4 points 11 months ago

Damn just install fzf

[-] dream_weasel@sh.itjust.works 3 points 11 months ago* (last edited 11 months ago)

!$(history | grep | awk '{print $1}' | tail -n1) || echo 'bad search, dummy.'

load more comments (1 replies)
[-] noctivius@lemm.ee 2 points 11 months ago

the alias that i have never set up*

load more comments
view more: next ›
this post was submitted on 21 May 2025
506 points (99.0% liked)

linuxmemes

31126 readers
217 users here now

Hint: :q!


Sister communities:


Community rules (click to expand)

1. Follow the site-wide rules

2. Be civil
  • Understand the difference between a joke and an insult.
  • Do not harrass or attack users for any reason. This includes using blanket terms, like "every user of thing".
  • Don't get baited into back-and-forth insults. We are not animals.
  • Leave remarks of "peasantry" to the PCMR community. If you dislike an OS/service/application, attack the thing you dislike, not the individuals who use it. Some people may not have a choice.
  • Bigotry will not be tolerated.
  • 3. Post Linux-related content
  • Including Unix and BSD.
  • Non-Linux content is acceptable as long as it makes a reference to Linux. For example, the poorly made mockery of sudo in Windows.
  • No porn, no politics, no trolling or ragebaiting.
  • Don't come looking for advice, this is not the right community.
  • 4. No recent reposts
  • Everybody uses Arch btw, can't quit Vim, <loves/tolerates/hates> systemd, and wants to interject for a moment. You can stop now.
  • 5. 🇬🇧 Language/язык/Sprache
  • This is primarily an English-speaking community. 🇬🇧🇦🇺🇺🇸
  • Comments written in other languages are allowed.
  • The substance of a post should be comprehensible for people who only speak English.
  • Titles and post bodies written in other languages will be allowed, but only as long as the above rule is observed.
  • 6. (NEW!) Regarding public figuresWe all have our opinions, and certain public figures can be divisive. Keep in mind that this is a community for memes and light-hearted fun, not for airing grievances or leveling accusations.
  • Keep discussions polite and free of disparagement.
  • We are never in possession of all of the facts. Defamatory comments will not be tolerated.
  • Discussions that get too heated will be locked and offending comments removed.
  •  

    Please report posts and comments that break these rules!


    Important: never execute code or follow advice that you don't understand or can't verify, especially here. The word of the day is credibility. This is a meme community -- even the most helpful comments might just be shitposts that can damage your system. Be aware, be smart, don't remove France.

    founded 2 years ago
    MODERATORS