Linux: How To Change Your Default Shell In A Couple Of Ways

Поделиться
HTML-код
  • Опубликовано: 13 сен 2024

Комментарии • 43

  • @BrodieRobertson
    @BrodieRobertson  4 года назад +5

    I thought I'd throw in a super beginner friendly video, I know that a lot of people already know how to do this, but if this helps someone who wasn't sure how to change their shell then I'm glad to be of service.

  • @davidvogel2387
    @davidvogel2387 4 года назад +7

    chsh -s $(which zsh) replace “zsh” with preferred shell
    echo $SHELL

  • @copper4eva
    @copper4eva 4 года назад +2

    "But if you're on Linux from scratch, I don't know why you're watching this"
    Fucking quote of the day there.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      If you're doing Linux from scratch and you don't know how to change your shell you should readdress your priorities

  • @seanbrec
    @seanbrec 4 года назад +5

    I symlink /bin/sh to dash, its a very minimal/posix compliant implementation, that runs quite a bit faster than bash/zsh. wiki.archlinux.org/index.php/Dash

  • @waltereikrem
    @waltereikrem 4 года назад +7

    "aiming for 1k subs". mate have you seen ur sub count, ur almost at 3k mah guy.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +3

      I didn't feel like re-recording the intro and outro for 7 videos after I got a shout out.

    • @bigO26
      @bigO26 4 года назад +1

      Mate have you seen your pee pee it's 1 inch

  • @BryanJenks
    @BryanJenks 4 года назад +3

    you can also get your current shell by "echo $0" :)

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      Someone else beat you to it

    • @BryanJenks
      @BryanJenks 4 года назад

      @@BrodieRobertson blast!

    • @siljrath
      @siljrath 4 года назад

      it also doesnt work for me ((already changed to/)in fish (which i presume is likely why)).

  • @humm535
    @humm535 4 года назад +3

    Let’s see what I can find in this video ...
    * on Arch, /bin is symlinked to /usr/bin, thus /bin/zsh is the same as /usr/bin/zsh.
    * there are ways to modify the environment without .profile scripts: rc scripts (not with sysD what Arch sadly uses), on OpenBSD the file /etc/login.conf, on Arch the ENV_PATH variable in /etc/login.defs, ...
    * even if you change the `shell` variable in st, it uses a few other things to determine the shell used, one of them $SHELL, which gets exported by login(1)
    * there should not be any problems running scripts (if $PATH is set correctly and stuff) after changing shells, because they are started as ordinary programs and the interpreter is only determined through the shebang (the #! line at the start)
    * on Arch, /bin/sh is a symlink to bash, I changed it on my machine to dash

  • @senanabanana1571
    @senanabanana1571 4 года назад +3

    I think /usr/bin/zsh is sym linked to /bin/zsh

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +3

      That was my assumption I just don't know what the point is.

    • @wilfridtaylor
      @wilfridtaylor 4 года назад +3

      @@BrodieRobertson Pretty much everything in /bin is syslinked to /usr/bin in arch. The story behind why there is /bin and /usr/bin actually goes back to the devs at bell labs running out of disk space and having to mount another disk.

    • @humm535
      @humm535 4 года назад +1

      @@BrodieRobertson @Wil T
      on Arch /bin is a symlink to /usr/bin, zsh itself doesn’t care about that.
      But yes, /usr originates from space issues at Bell Labs on single storage mediums.

  • @jimmygkia
    @jimmygkia 4 года назад +2

    Leftwm review? Rust based wm... Also hunter.... A ranger/lf alternative in rust (has previews...)... And ion shell... Rust shell for redox os but can be used in Linux, apparently

  • @humm535
    @humm535 4 года назад +2

    If the login shell is not available, login(1) from util-linux just says “login incorrect”.
    For some reason, the install script for the zsh Arch package adds both /bin/zsh and /usr/bin/zsh to /etc/shells.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      So it will just stop you being able to login then, that's what I assumed would happened.

  • @copper4eva
    @copper4eva 4 года назад +1

    Not gonna lie, I've been meaning to switch to ZSH, but have been to lazy to figure out how to actually switch lmao (newish user in case you can't tell).

  • @blattiblatte
    @blattiblatte 4 года назад +3

    chsh doesn't need sudo because it's got the suid bit.

  • @yoshi314
    @yoshi314 4 года назад +1

    huh chsh -l doesn't work on my gentoo install.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      That's weird i had a look into Gentoo it seems to come with chsh, check the man page, maybe the option is different.

    • @yoshi314
      @yoshi314 4 года назад

      @@BrodieRobertson it only provides -R and -s
      it belongs to package shadow-4.8.1. Perhaps it's too old.

    • @williamjohn1815
      @williamjohn1815 4 года назад +1

      Try cat /etc/shells works on Debian. As chsh -l is not working.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад

      @@williamjohn1815 is it just the Arch version that has this option?

    • @williamjohn1815
      @williamjohn1815 4 года назад

      @@BrodieRobertson For some reason it seems to be as the command is on the arch wiki. I even checked the Debian repo in case something was not install which stopped the command from working on Debian. I have noted both commands in my help files. Thanks you for your work.

  • @siljrath
    @siljrath 4 года назад +1

  • @GrumpyCrash
    @GrumpyCrash 4 года назад +2

    zsh is not considered a standard software and it has mostly the purpose of portability. Install ksh(1) and you will find it in /bin/ksh and /usr/bin/ksh. And please.. in the name of all gods! .. dont tell people to edit the passwd directly! $SHELL is wrong in this case because this variable shall represent a pathname of the user's preferred command language interpreter. $0 shows you the actually used shell. A "nologin shell" is for daemons like http, smtp oder simple for users with just "ftp privileges" (/bin/nologin, /sbin/nologin, ..). /bin/sh is mostly a symlink against bash or ash.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      I didn't tell people to do it, I showed them that it can be done if for some weird reason you need to. I didn't realise they were different, I've never had a situation where I noticed that they differed.

    • @GrumpyCrash
      @GrumpyCrash 4 года назад +1

      @@BrodieRobertson There is absolutely no reason for editing /etc/passwd directly. Bad habits under linux are.. well.. bad.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад

      @@GrumpyCrash I'm not going to pretend that you can't do something in a dangerous way, I specifically said I don't trust myself not to break something so I'm not going to save my changes. There shouldn't be a reason but there could be.

  • @siljrath
    @siljrath 4 года назад

    will you shut up about the subscriptions once you hit your next landmark? ~ it's distracting annoying off-putting and makes me consider unsubscribing.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад

      I've changed up my intro after the backlog is over

    • @siljrath
      @siljrath 4 года назад +1

      sry, that was an overly harsh way of putting that. loving the content, great service, hampered by the subscription requests.

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      I've kept it in the outro but I've wanted to slim down my intro for a while

    • @bigO26
      @bigO26 4 года назад

      Will you shut up, we know your boyfriend isn't putting out

  • @copper4eva
    @copper4eva 4 года назад +2

    Not gonna lie, I've been meaning to switch to ZSH, but have been to lazy to figure out how to actually switch lmao (newish user in case you can't tell).

    • @BrodieRobertson
      @BrodieRobertson  4 года назад +1

      I've only been on Linux for about 7 months, I know the feeling