2. Linux Shell



Linux Shell


The shell is an interface for you to interact with your operating system (OS). As you type commands into the shell, it's responsible for interpreting those commands.

Operations like copying files, piping, listing files are all within a shell's remit.

Several Linux shells are available. To find out all the shells that are available on your system, open the terminal and type:

   cat /etc/shells



To find out what shell you're currently using type:


    echo $0




Other shells are tsch, fish, KornShell, and Z Shell.

How to change the shell to use another one?

If you want to use a different shell, you can simply type its name and you’ll be logged into the new shell. For example, if you install fish (sudo apt install fish) and want to use it, you can simply use:



                                                     to use fish




You can enter exit to exit from the new shell and return to the previous one.

2 Ways to Change a Users Default Shell in Linux:

usermod is a utility for modifying a user’s account details, stored in the /etc/passwd file and the -s or --shell option is used to change the user’s login shell.



In this example, we’ll first check user usuario’s account information to view his default login shell (cat /etc/passwd) and then change its login shell from /bin/bash to /bin/sh as follows.

NOTE: The sudo command will basically execute anything you want in the system as if the administrator's account ‘root’ was doing it.


chsh is a command line utility for changing a login shell with the -s or –shell option like this:

    



Sources: https://www.makeuseof.com/tag/best-linux-shells/

                https://linuxhandbook.com/change-user-command-line/

                https://www.tecmint.com/change-a-users-default-shell-in-linux/

              

Comentarios

Entradas populares de este blog

1. Linux Kernel