It can’t hurt to share some of you current helpers. Either someone else might get inspired by or in some cases you get suggestions how to make it better. Bash, Zsh, Fish or whatever shell script, command or alias (or abbreviation) you have, share here. Always fun to do so! I share mine in the comments, just like everybody else.

  • Kai e'Kael@lemmy.today
    link
    fedilink
    arrow-up
    2
    ·
    2 days ago

    I forget whom to blame for getting stuck with these. I want to say Slackware…in 1994.

    alias d='ls -aF --color=auto'
    alias v='d -l'
    
    

    And of course the ones I always recommend heartily:

    alias cp='cp -i'
    alias mv='mv -i'
    alias rm='rm -i'
    
    • thingsiplay@lemmy.mlOP
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      1 day ago

      I actually never used the -i option on any of these commands. On one hand I do not like having default options for file operations like these. Especially so with remove command. However I have to say, the uppercase -I on rm is quiet appealing, as it only kicks in with more than 3 files or when recursive. How you deal when you don’t need the interactive modes? My guess is just using a backslash like \rm in example, which will ignore aliases.

      • Kai e'Kael@lemmy.today
        link
        fedilink
        arrow-up
        2
        ·
        1 hour ago

        I use the interactive as a safeguard. Nothing worse then typing rm accidentally. Better to have the yes/no pop up, review, ctl-c, up-ctrl-a--enter to put it into effect…or just hit y a few times if for just a few files.

        Similar for cp, an overwrite is usually never intended, prefer to “are you sure” than find out much much later that was the wrong directory.

        • thingsiplay@lemmy.mlOP
          link
          fedilink
          arrow-up
          1
          ·
          56 minutes ago

          I totally agree, its a little bit dangerous. And understand why you add the safety net. My logic is, if you never take off the “training wheels”, you will never get a feeling how dangerous the commands are. I mean you are used to the safety net and your brain doesn’t have the same precautions and alarm bells active, as if there was none. And when you are on a machine without those, then you might quickly end up in an issue caused by muscle memory.

          That’s my whole logic behind it, why I didn’t do any alias to the rm command in example, even though I totally get and understand your point to be more careful. In fact, I’m so afraid of the command, that I sometimes just open up the GUI filemanager to delete files or folders, as I feel its more secure.

          BTW there is also a tool called trash-cli, which “deletes” (moves) files to the trash bin instead deleting them completely. Similar to how its done on the GUI. My original intention was to alias it to rm, but after thinking this through decided against it with given reasons.