#! /Bin/sh and $ bash #! /Bin/sh indicates that the script is interpreted and executed using/bin/sh ,#! Is a special identifier, followed by the path of the shell that explains the script. Www.2cto.com $ bash $ indicates the system prompt, $ indicates that this user is a common user, and the super user's prompt is #. Bash is a shell and the most common shell in linux. $ Bash refers to executing a subshell, Which Is bash. Note that "#! ", Which means that you need to specify an interpreter for executing the system file .#! It is actually a 2-byte [1] magic number, which specifies a special mark of the file type, in other words, in this case, it refers to an executable script (type man magic to get more details about this fascinating topic ). www.2cto.com on #! Followed by a path name. this path name specifies a program that interprets commands in the script. This program can be a shell, program language, or any common program. this specified program starts from the beginning and executes the commands in the script (from #! At the beginning of the line), ignore the comment. [2] For example: 1 #! /Bin/sh 2 #! /Bin/bash 3 #! /Usr/bin/perl 4 #! /Usr/bin/tcl 5 #! /Bin/sed-f 6 #! /Usr/awk-f Note :#! The path name provided later must be correct. Otherwise, an error message is displayed, usually "Command not found", which is the only result you get when running this script. if there is another # in the script #! Line, bash will regard it as a normal comment line.