• Rodeo@lemmy.ca
    link
    fedilink
    arrow-up
    10
    ·
    1 year ago

    You could just use aliases in your bashrc

    alias dl=cd ~/Downloads

    Might need quotes around the command.

    • darcy@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      sure, but what if need a subfolder of dl, like dl/source or whatever. same with documents and pictures

      • Rodeo@lemmy.ca
        link
        fedilink
        arrow-up
        2
        ·
        1 year ago

        You have to try it but I think it still works. Aliases just replaced the text you typed with text in the alias, so if you append a subfolder to the alias it should also be appended to the command.

        It’s like using !! when navigating folders. You can do cd ~/Downloads and then !!/source and it resolves to cd ~/Downloads/source

      • MrScottyTay@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        I’m sure that still works with aliases. Then you’ll have dl/source and Doenloads/source that are the same location. Using aliases will mean any script or program you may use that might point to them won’t just create a new default folder that is then no longer the same location as the renamed one that you’ll expect everything in