-1

Good evening. Please help me with the meanings of these 4 commands:

  • /bin/sh
  • /bin/dash
  • /bin/bash
  • /bin/nbash

Google Translate of:

Bonsoir svp aide moi avec la signification de ces 4 commendes:

  • /bin/sh
  • /bin/dash
  • /bin/bash
  • /bin/nbash
bummi
  • 394
  • 3
  • 9
  • 14

1 Answers1

0

Bash is the Bourne Again Shell, and Dash is the Debian Almquist Shell. The shells are used to interact with the system via commands. See What is the difference between Terminal, Console, Shell, and Command Line? and What is a shell?

/bin/sh is a shell whose behaviour is expected to conform to the POSIX standard. It allows people to write scripts that can work across a variety of Unix-like systems without worrying about whether the system has ksh or bash or zsh or something else. Originally, /bin/sh was the Bourne Shell, but nowadays, practically no one provides the Bourne Shell as /bin/sh. Everyone symlinks /bin/sh to another shell, often /bin/bash on Linux systems. Debian and descendants (including Ubuntu) are the biggest exception - they symlink /bin/sh to /bin/dash.

There is no /bin/nbash, but perhaps you meant /bin/rbash. rbash runs bash with restrictions. Quoting the manual:

[The] following are disallowed or not performed:

  • Changing directories with the cd builtin.
  • Setting or unsetting the values of the SHELL, PATH, ENV, or BASH_ENV variables.
  • Specifying command names containing slashes.
  • Specifying a filename containing a slash as an argument to the . builtin command.
  • Specifying a filename containing a slash as an argument to the -p option to the hash builtin command.
  • Importing function definitions from the shell environment at startup.
  • Parsing the value of SHELLOPTS from the shell environment at startup.
  • Redirecting output using the ‘>’, ‘>|’, ‘<>’, ‘>&’, ‘&>’, and ‘>>’ redirection operators.
  • Using the exec builtin to replace the shell with another command.
  • Adding or deleting builtin commands with the -f and -d options to the enable builtin.
  • Using the enable builtin command to enable disabled shell builtins.
  • Specifying the -p option to the command builtin.
  • Turning off restricted mode with ‘set +r’ or ‘set +o restricted’.

These restrictions are enforced after any startup files are read.

muru
  • 197,895
  • 55
  • 485
  • 740