Arch linux which shell

Command-line shell

A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering commands as text for a command line interpreter to execute or by creating text scripts of one or more such commands.

List of shells

Shells that are more or less POSIX compliant are listed under #POSIX compliant, while shells that have a different syntax are under #Alternative shells.

POSIX compliant

These shells can all be linked from /usr/bin/sh . When Bash, mksh AUR and zsh are invoked with the sh name, they automatically become more POSIX compliant.

  • Bash — Bash extends the Bourne shell with command-line history and completion, indexed and associative arrays, integer arithmetic, process substitution, here strings, regular expression matching and brace expansion.
  • Dash — Descendant of the NetBSD version of the Almquist SHell (ash). A fast POSIX-compliant shell that aims to be as small as possible.
  • KornShell (ksh) — The KornShell language is a complete, powerful, high-level programming language for writing applications, often more easily and quickly than with other high-level languages. This makes it especially suitable for prototyping. ksh has the best features of the Bourne shell and the C shell, plus many new features of its own. Thus ksh can do much to enhance your productivity and the quality of your work, both in interacting with the system, and in programming. ksh programs are easier to write, and are more concise and readable than programs written in a lower level language such as C.
  • Oil Shell (OSH) — Oil Shell is a Bash-compatible UNIX command-line shell. OSH can be run on most UNIX-like operating systems, including GNU/Linux. It is written in Python (v2.7), but ships with a native executable. The dialect of Bash recognized by OSH is called the OSH language.
  • Yash — Yet another shell, is a POSIX-compliant command line shell written in C99 (ISO/IEC 9899:1999). Yash is intended to be the most POSIX-compliant shell in the world while supporting features for daily interactive and scripting use.
  • Zsh — Shell designed for interactive use, although it is also a powerful scripting language. Many of the useful features of Bash, ksh, and tcsh were incorporated into Zsh; many original features were added. The introductory document details some of the unique features of Zsh.
Читайте также:  Cisco anyconnect secure mobility client linux

Alternative shells

  • C shell (tcsh) — Command language interpreter usable both as an interactive login shell and a shell script command processor. It includes a command-line editor, programmable word completion, spelling correction, a history mechanism, job control and a C-like syntax.
  • Elvish — Elvish is a modern and expressive shell, that can carry internal structured values through pipelines. This feature makes possible avoiding a lot of complex text processing code. It features an expressive programming language, with features like exceptions, namespacing and anonymous functions. It also has a powerful readline which checks the syntax while typing, and syntax highlighting by default.
  • fish — Smart and user-friendly command line shell. Fish performs full-color command line syntax highlighting, as well as highlighting and completion for commands and their arguments, file existence, and history. It supports complete-as-you-type for history and commands. Fish is able to parse the system’s man pages in order to determine valid arguments for commands, allowing it to highlight and complete commands. Easy last-command revision can be done using Alt+Up . The fish daemon (fishd) facilitates synchronized history across all instances of fish, as well as universal and persistent environment variables. Additionally, fish features significantly simplified programming syntax and control flow (similar to ruby). For more information, see the tutorial.
  • ion — Ion is a modern system shell that features a simple, yet powerful, syntax. It is written entirely in Rust, which greatly increases the overall quality and security of the shell, eliminating the possibilities of a ShellShock-like vulnerability, and making development easier. It also offers a level of performance that exceeds that of Dash, when taking advantage of Ion’s features. While it is developed alongside, and primarily for, RedoxOS, it is a fully capable on other *nix platforms. For more details lookup its manual.
  • Nash — Nash is a system shell, inspired by plan9 rc, that makes it easy to create reliable and safe scripts taking advantages of operating systems namespaces (on Linux and plan9) in an idiomatic way.
  • nushell — Nu draws inspiration from functional programming languages, and modern CLI tools. Rather than thinking of files and services as raw streams of text, Nu looks at each input as something with structure.
  • Oh — Unix shell written in Go. It is similar in spirit but different in detail from other Unix shells. Oh extends the shell’s programming language features without sacrificing the shell’s interactive features.
  • PowerShell — PowerShell is an object-oriented programming language and interactive command line shell, originally written for and exclusive to Windows. Later on, it was open sourced and ported to macOS and Linux.
  • rc — Command interpreter for Plan 9 that provides similar facilities to UNIX’s Bourne shell, with some small additions and less idiosyncratic syntax.
  • xonsh — Python-powered shell with additional shell primitives that you are used to from Bash and IPython.
Читайте также:  Linux for windows mobile phones

Changing your default shell

After installing one of the above shells, you can execute that shell inside of your current shell, by just running its executable. If you want to be served that shell when you login however, you will need to change your default shell.

To list all installed shells, run:

And to set one as default for your user do:

$ chsh -s full-path-to-shell 
$ homectl update --shell=full-path-to-shell user 

where full-path-to-shell is the full path as given by chsh -l .

If you now log out and log in again, you will be greeted by the other shell.

Tip: chsh uses /etc/shells as reference. If a recently installed shell is not present on the list, it can be manually added to this file.

Uninstalling shell

Warning: Failure to follow the below procedure may result in users no longer having access to a working shell.

Change the default shell before removing the package of the shell.

Use it for every user with a shell other than bash set as their login shell (including root if needed). When completed, the package can be removed.

Login shell

A login shell is an invocation mode, in which the shell reads files intended for one-time initialization, such as system-wide /etc/profile or the user’s ~/.profile or other shell-specific file(s). These files set up the initial environment, which is inherited by all other processes started from the shell (including other non-login shells or graphical programs). Hence, they are read only once at the beginning of a session, which is, for example, when the user logs in to the console or via SSH, changes the user with sudo or su using the —login parameter, or when the user manually invokes a login shell (e.g. by bash —login ).

See #Configuration files and the links therein for an overview of the various initialization files. For more information about login shell, see also Difference between Login Shell and Non-Login Shell? and Why a «login» shell over a «non-login» shell? on Stack Exchange.

Configuration files

To autostart programs in console or upon login, you can use shell startup files/directories. Read the documentation for your shell, or its ArchWiki article, e.g. Bash#Configuration files or Zsh#Startup/Shutdown files.

Читайте также:  Linux caps lock не работает

See also Wikipedia:Unix shell#Configuration files for a comparison of various configuration files of various shells.

/etc/profile

Upon login, all Bourne-compatible shells source /etc/profile , which in turn sources any readable *.sh files in /etc/profile.d/ : these scripts do not require an interpreter directive, nor do they need to be executable. They are used to set up an environment and define application-specific settings.

Standardisation

It is possible to make (some) shells configuration files follow the same naming convention, as well as supporting some common configuration between the shells.

Input and output

    Redirections truncate files before commands are executed:

$ command file > file

See also

  • Evolution of shells in Linux on the IBM developerWorks
  • terminal.sexy — Terminal Color Scheme Designer
  • Hyperpolyglot — Side-by-side comparison of shell syntaxes
  • UNIX Power Tools — General command-line tool usage
  • commandlinefu.com — Command-line snippets sharing
  • List of applications#Terminal emulators
  • This page was last edited on 5 June 2023, at 17:20.
  • Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.
  • Privacy policy
  • About ArchWiki
  • Disclaimers

Источник

DESCRIPTION

chsh is used to change your login shell. If a shell is not given on the command line, chsh prompts for one.

chsh supports non-local entries (kerberos, LDAP, etc.) if linked with libuser, otherwise use ypchsh(1), lchsh(1) or any other implementation for non-local entries.

OPTIONS

-s, —shell shell

Display help text and exit. The short options -h have been used since version 2.30; old versions use deprecated -u.

Print version and exit. The short options -V have been used since version 2.39; old versions use deprecated -v.

VALID SHELLS

chsh will accept the full pathname of any executable file on the system.

The default behavior for non-root users is to accept only shells listed in the /etc/shells file, and issue a warning for root user. It can also be configured at compile-time to only issue a warning for all users.

EXIT STATUS

Returns 0 if operation was successful, 1 if operation failed or command syntax was not valid.

AUTHORS

SEE ALSO

REPORTING BUGS

AVAILABILITY

The chsh command is part of the util-linux package which can be downloaded from Linux Kernel Archive https://www.kernel.org/pub/linux/utils/util-linux/.

Powered by archmanweb, using mandoc for the conversion of manual pages.

The website is available under the terms of the GPL-3.0 license, except for the contents of the manual pages, which have their own license specified in the corresponding Arch Linux package.

Источник

Оцените статью
Adblock
detector