Do all different Linux distributions have the same command lines? [closed]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
1












Do all different Linux distributions have the same command lines? What I want to know is the same command line works for all kinds of Linux distributions (CentOS, Fedora, Ubuntu, etc.) or whether they all have different command lines?










share|improve this question















closed as too broad by αғsнιη, muru, RalfFriedl, Ipor Sircer, Goro Sep 28 at 8:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    This is a hard-to-find-on-internet question, just like any beginner-level questions, asked with some misunderstanding about general level system structure/layers. It's like no community welcome such questions, causing too much pain for beginners.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:17














up vote
3
down vote

favorite
1












Do all different Linux distributions have the same command lines? What I want to know is the same command line works for all kinds of Linux distributions (CentOS, Fedora, Ubuntu, etc.) or whether they all have different command lines?










share|improve this question















closed as too broad by αғsнιη, muru, RalfFriedl, Ipor Sircer, Goro Sep 28 at 8:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    This is a hard-to-find-on-internet question, just like any beginner-level questions, asked with some misunderstanding about general level system structure/layers. It's like no community welcome such questions, causing too much pain for beginners.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:17












up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





Do all different Linux distributions have the same command lines? What I want to know is the same command line works for all kinds of Linux distributions (CentOS, Fedora, Ubuntu, etc.) or whether they all have different command lines?










share|improve this question















Do all different Linux distributions have the same command lines? What I want to know is the same command line works for all kinds of Linux distributions (CentOS, Fedora, Ubuntu, etc.) or whether they all have different command lines?







linux command-line command portability






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Sep 28 at 10:15









Kusalananda

108k14209333




108k14209333










asked Sep 28 at 4:02









Kaung Sett

326




326




closed as too broad by αғsнιη, muru, RalfFriedl, Ipor Sircer, Goro Sep 28 at 8:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as too broad by αғsнιη, muru, RalfFriedl, Ipor Sircer, Goro Sep 28 at 8:52


Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.









  • 1




    This is a hard-to-find-on-internet question, just like any beginner-level questions, asked with some misunderstanding about general level system structure/layers. It's like no community welcome such questions, causing too much pain for beginners.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:17












  • 1




    This is a hard-to-find-on-internet question, just like any beginner-level questions, asked with some misunderstanding about general level system structure/layers. It's like no community welcome such questions, causing too much pain for beginners.
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:17







1




1




This is a hard-to-find-on-internet question, just like any beginner-level questions, asked with some misunderstanding about general level system structure/layers. It's like no community welcome such questions, causing too much pain for beginners.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 28 at 14:17




This is a hard-to-find-on-internet question, just like any beginner-level questions, asked with some misunderstanding about general level system structure/layers. It's like no community welcome such questions, causing too much pain for beginners.
– ç¥žç§˜å¾·é‡Œå…‹
Sep 28 at 14:17










3 Answers
3






active

oldest

votes

















up vote
9
down vote



accepted










I'm choosing to interpret this question as a question about the portability of commands and shells across various Linux distributions. A "command line" could mean both "a command written at the shell prompt" and "the shell itself". Hopefully this answer addresses both these interpretations of "command line".




Most Unix systems provide the same basic utilities for working at the shell prompt. These utilities are working largely in the same way since they are standardised. Also, the syntax used for writing shell commands is standardised (loops, redirections, pipes, background processes, variable assignments, quoting etc.) The standard is called POSIX and may be found here (see the "Shell & Utilities" section).



On most Unices (especially on Linux for some reason), the standard utilities have been extended with extra functionality, but the functionality described by the POSIX standard should be implemented. If a standard utility does not conform to the POSIX standard, you should probably file a bug report about this.



In particular, the shell itself is often extended to give a more convenient interactive experience, or to be able to provide more advanced shell programming facilities. The shell, being an application like any other, comes in various flavours (implementations) and bash is the most popular on Linux systems (but it's also available as the default shell on e.g. macOS and may be installed on any Unix). The zsh and ksh shells are also popular and provide different sets of extensions, but all should at least be able to do largely what the POSIX standard says using a common syntax (except when using extensions such as special types of arrays and fancier forms of filename pattern matching etc. although some of this happens to be fairly similar between shells too).



As for non-standard tools, such as tools for doing some specific task that is not covered by the POSIX standard (such as talking to a database or adjusting the brightness level of a monitor), or that are specific to a particular Linux distribution (maybe for doing package management), to a version of a particular Linux distribution, or to a particular hardware architecture etc., the portability of the command would depend on the correct variant and version of the tool being installed on a system that supports using that tool.



Across various Linux distributions, the assortment of available tools and utilities is fairly homogenous, and portability is generally good (with the caveat that distribution and architecture specific tools may be different or missing). When looking at using and writing scripts that should work on other types of Unix systems, it becomes more important to know about what extensions are particular to the GNU/Linux variation of tools and utilities, and what can be expected to work on "a generic POSIX/Unix system".






share|improve this answer






















  • So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
    – Kaung Sett
    Sep 28 at 7:45






  • 1




    @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
    – Kusalananda
    Sep 28 at 7:49










  • @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
    – Kusalananda
    Sep 28 at 7:50










  • @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
    – Kaung Sett
    Sep 28 at 7:54










  • There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:09

















up vote
4
down vote













Linux is just a kernel, not OS, things you use directly like commands or GUI programs or beautiful desktops are not provided by the kernel, but by userland components, which are distributed with OSes.



Commands you used in the shell comes from shell builtin functions or external software package. Depending on the softwares you installed, they can be same or different. Although you always use commands in your shell, but they actually have nearly nothing to do with your shell(This even apply to Windows/OS X/*BSD), just learn about how your shell work.



It's just some distros will default-ly install some common software for you, so you get some common commands available. Like you can use ls on almost all distros just 'cause almost all distros install the linux-utils software for you.



In some distros, you have more freedom to choose the packages you want, in that case, you may not get ls available if you refuse to install linux-utils or any software that can provide this command. Also notice that different software packages MAY conflict with each other if they provide commands with the same name.






share|improve this answer





























    up vote
    3
    down vote













    How a command line is interpreted depends on the shell that is running and how the called program interprets its arguments.



    There's a number of different shells, and a command line using a particular feature of one shell may not work on another shell.



    That said, in general, the various Linux distros all include at least the same basic shells, so if you can make sure you are executing the same shell, you can use the same command line. (That's why in shell scripts you usually put the needed shell in the first line).



    Edit



    Look at the shell scripts e.g. in old-style /etc/init.d, and each of those starts with



    #!/bin/sh


    So these expect some sort of standard shell, which e.g. on Debian is provided by dash. To compare, the shell scripts I write for myself start with



    #!/bin/bash


    because I sometimes use bash extensions. There's a ton of other shells, see e.g. here






    share|improve this answer






















    • Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
      – Kaung Sett
      Sep 29 at 15:16

















    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    9
    down vote



    accepted










    I'm choosing to interpret this question as a question about the portability of commands and shells across various Linux distributions. A "command line" could mean both "a command written at the shell prompt" and "the shell itself". Hopefully this answer addresses both these interpretations of "command line".




    Most Unix systems provide the same basic utilities for working at the shell prompt. These utilities are working largely in the same way since they are standardised. Also, the syntax used for writing shell commands is standardised (loops, redirections, pipes, background processes, variable assignments, quoting etc.) The standard is called POSIX and may be found here (see the "Shell & Utilities" section).



    On most Unices (especially on Linux for some reason), the standard utilities have been extended with extra functionality, but the functionality described by the POSIX standard should be implemented. If a standard utility does not conform to the POSIX standard, you should probably file a bug report about this.



    In particular, the shell itself is often extended to give a more convenient interactive experience, or to be able to provide more advanced shell programming facilities. The shell, being an application like any other, comes in various flavours (implementations) and bash is the most popular on Linux systems (but it's also available as the default shell on e.g. macOS and may be installed on any Unix). The zsh and ksh shells are also popular and provide different sets of extensions, but all should at least be able to do largely what the POSIX standard says using a common syntax (except when using extensions such as special types of arrays and fancier forms of filename pattern matching etc. although some of this happens to be fairly similar between shells too).



    As for non-standard tools, such as tools for doing some specific task that is not covered by the POSIX standard (such as talking to a database or adjusting the brightness level of a monitor), or that are specific to a particular Linux distribution (maybe for doing package management), to a version of a particular Linux distribution, or to a particular hardware architecture etc., the portability of the command would depend on the correct variant and version of the tool being installed on a system that supports using that tool.



    Across various Linux distributions, the assortment of available tools and utilities is fairly homogenous, and portability is generally good (with the caveat that distribution and architecture specific tools may be different or missing). When looking at using and writing scripts that should work on other types of Unix systems, it becomes more important to know about what extensions are particular to the GNU/Linux variation of tools and utilities, and what can be expected to work on "a generic POSIX/Unix system".






    share|improve this answer






















    • So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
      – Kaung Sett
      Sep 28 at 7:45






    • 1




      @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
      – Kusalananda
      Sep 28 at 7:49










    • @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
      – Kusalananda
      Sep 28 at 7:50










    • @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
      – Kaung Sett
      Sep 28 at 7:54










    • There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
      – ç¥žç§˜å¾·é‡Œå…‹
      Sep 28 at 14:09














    up vote
    9
    down vote



    accepted










    I'm choosing to interpret this question as a question about the portability of commands and shells across various Linux distributions. A "command line" could mean both "a command written at the shell prompt" and "the shell itself". Hopefully this answer addresses both these interpretations of "command line".




    Most Unix systems provide the same basic utilities for working at the shell prompt. These utilities are working largely in the same way since they are standardised. Also, the syntax used for writing shell commands is standardised (loops, redirections, pipes, background processes, variable assignments, quoting etc.) The standard is called POSIX and may be found here (see the "Shell & Utilities" section).



    On most Unices (especially on Linux for some reason), the standard utilities have been extended with extra functionality, but the functionality described by the POSIX standard should be implemented. If a standard utility does not conform to the POSIX standard, you should probably file a bug report about this.



    In particular, the shell itself is often extended to give a more convenient interactive experience, or to be able to provide more advanced shell programming facilities. The shell, being an application like any other, comes in various flavours (implementations) and bash is the most popular on Linux systems (but it's also available as the default shell on e.g. macOS and may be installed on any Unix). The zsh and ksh shells are also popular and provide different sets of extensions, but all should at least be able to do largely what the POSIX standard says using a common syntax (except when using extensions such as special types of arrays and fancier forms of filename pattern matching etc. although some of this happens to be fairly similar between shells too).



    As for non-standard tools, such as tools for doing some specific task that is not covered by the POSIX standard (such as talking to a database or adjusting the brightness level of a monitor), or that are specific to a particular Linux distribution (maybe for doing package management), to a version of a particular Linux distribution, or to a particular hardware architecture etc., the portability of the command would depend on the correct variant and version of the tool being installed on a system that supports using that tool.



    Across various Linux distributions, the assortment of available tools and utilities is fairly homogenous, and portability is generally good (with the caveat that distribution and architecture specific tools may be different or missing). When looking at using and writing scripts that should work on other types of Unix systems, it becomes more important to know about what extensions are particular to the GNU/Linux variation of tools and utilities, and what can be expected to work on "a generic POSIX/Unix system".






    share|improve this answer






















    • So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
      – Kaung Sett
      Sep 28 at 7:45






    • 1




      @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
      – Kusalananda
      Sep 28 at 7:49










    • @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
      – Kusalananda
      Sep 28 at 7:50










    • @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
      – Kaung Sett
      Sep 28 at 7:54










    • There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
      – ç¥žç§˜å¾·é‡Œå…‹
      Sep 28 at 14:09












    up vote
    9
    down vote



    accepted







    up vote
    9
    down vote



    accepted






    I'm choosing to interpret this question as a question about the portability of commands and shells across various Linux distributions. A "command line" could mean both "a command written at the shell prompt" and "the shell itself". Hopefully this answer addresses both these interpretations of "command line".




    Most Unix systems provide the same basic utilities for working at the shell prompt. These utilities are working largely in the same way since they are standardised. Also, the syntax used for writing shell commands is standardised (loops, redirections, pipes, background processes, variable assignments, quoting etc.) The standard is called POSIX and may be found here (see the "Shell & Utilities" section).



    On most Unices (especially on Linux for some reason), the standard utilities have been extended with extra functionality, but the functionality described by the POSIX standard should be implemented. If a standard utility does not conform to the POSIX standard, you should probably file a bug report about this.



    In particular, the shell itself is often extended to give a more convenient interactive experience, or to be able to provide more advanced shell programming facilities. The shell, being an application like any other, comes in various flavours (implementations) and bash is the most popular on Linux systems (but it's also available as the default shell on e.g. macOS and may be installed on any Unix). The zsh and ksh shells are also popular and provide different sets of extensions, but all should at least be able to do largely what the POSIX standard says using a common syntax (except when using extensions such as special types of arrays and fancier forms of filename pattern matching etc. although some of this happens to be fairly similar between shells too).



    As for non-standard tools, such as tools for doing some specific task that is not covered by the POSIX standard (such as talking to a database or adjusting the brightness level of a monitor), or that are specific to a particular Linux distribution (maybe for doing package management), to a version of a particular Linux distribution, or to a particular hardware architecture etc., the portability of the command would depend on the correct variant and version of the tool being installed on a system that supports using that tool.



    Across various Linux distributions, the assortment of available tools and utilities is fairly homogenous, and portability is generally good (with the caveat that distribution and architecture specific tools may be different or missing). When looking at using and writing scripts that should work on other types of Unix systems, it becomes more important to know about what extensions are particular to the GNU/Linux variation of tools and utilities, and what can be expected to work on "a generic POSIX/Unix system".






    share|improve this answer














    I'm choosing to interpret this question as a question about the portability of commands and shells across various Linux distributions. A "command line" could mean both "a command written at the shell prompt" and "the shell itself". Hopefully this answer addresses both these interpretations of "command line".




    Most Unix systems provide the same basic utilities for working at the shell prompt. These utilities are working largely in the same way since they are standardised. Also, the syntax used for writing shell commands is standardised (loops, redirections, pipes, background processes, variable assignments, quoting etc.) The standard is called POSIX and may be found here (see the "Shell & Utilities" section).



    On most Unices (especially on Linux for some reason), the standard utilities have been extended with extra functionality, but the functionality described by the POSIX standard should be implemented. If a standard utility does not conform to the POSIX standard, you should probably file a bug report about this.



    In particular, the shell itself is often extended to give a more convenient interactive experience, or to be able to provide more advanced shell programming facilities. The shell, being an application like any other, comes in various flavours (implementations) and bash is the most popular on Linux systems (but it's also available as the default shell on e.g. macOS and may be installed on any Unix). The zsh and ksh shells are also popular and provide different sets of extensions, but all should at least be able to do largely what the POSIX standard says using a common syntax (except when using extensions such as special types of arrays and fancier forms of filename pattern matching etc. although some of this happens to be fairly similar between shells too).



    As for non-standard tools, such as tools for doing some specific task that is not covered by the POSIX standard (such as talking to a database or adjusting the brightness level of a monitor), or that are specific to a particular Linux distribution (maybe for doing package management), to a version of a particular Linux distribution, or to a particular hardware architecture etc., the portability of the command would depend on the correct variant and version of the tool being installed on a system that supports using that tool.



    Across various Linux distributions, the assortment of available tools and utilities is fairly homogenous, and portability is generally good (with the caveat that distribution and architecture specific tools may be different or missing). When looking at using and writing scripts that should work on other types of Unix systems, it becomes more important to know about what extensions are particular to the GNU/Linux variation of tools and utilities, and what can be expected to work on "a generic POSIX/Unix system".







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Sep 28 at 11:29

























    answered Sep 28 at 6:49









    Kusalananda

    108k14209333




    108k14209333











    • So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
      – Kaung Sett
      Sep 28 at 7:45






    • 1




      @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
      – Kusalananda
      Sep 28 at 7:49










    • @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
      – Kusalananda
      Sep 28 at 7:50










    • @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
      – Kaung Sett
      Sep 28 at 7:54










    • There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
      – ç¥žç§˜å¾·é‡Œå…‹
      Sep 28 at 14:09
















    • So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
      – Kaung Sett
      Sep 28 at 7:45






    • 1




      @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
      – Kusalananda
      Sep 28 at 7:49










    • @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
      – Kusalananda
      Sep 28 at 7:50










    • @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
      – Kaung Sett
      Sep 28 at 7:54










    • There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
      – ç¥žç§˜å¾·é‡Œå…‹
      Sep 28 at 14:09















    So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
    – Kaung Sett
    Sep 28 at 7:45




    So, to put it in a nutshell, there may be some basic standard command lines which works in all of the linux system whereas extra/extended ones do not.
    – Kaung Sett
    Sep 28 at 7:45




    1




    1




    @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
    – Kusalananda
    Sep 28 at 7:49




    @KaungSett If the command uses only standard tools and no extended features, then there is a higher probability that it is portable. Between homogenous types of Unices, such as various Linuxes (that are using the same implementation of the tools), it is more probable that the command is portable, depending on what it actually is it's doing.
    – Kusalananda
    Sep 28 at 7:49












    @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
    – Kusalananda
    Sep 28 at 7:50




    @KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
    – Kusalananda
    Sep 28 at 7:50












    @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
    – Kaung Sett
    Sep 28 at 7:54




    @ Kusalananda Thanks for your answer. TBH, I've just started learning the basic of Linux and this question got pop up in my head. I've tried to google it though but none of them seems to answer my question so here I am.
    – Kaung Sett
    Sep 28 at 7:54












    There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:09




    There are no basic/extended commands concept. But built-in functions/user-defined functions/external programs in PATH. You need to know what a shell is, it's not commands provider, but more like a user interface for you to use commands provided by other things.@Kaung Sett
    – ç¥žç§˜å¾·é‡Œå…‹
    Sep 28 at 14:09












    up vote
    4
    down vote













    Linux is just a kernel, not OS, things you use directly like commands or GUI programs or beautiful desktops are not provided by the kernel, but by userland components, which are distributed with OSes.



    Commands you used in the shell comes from shell builtin functions or external software package. Depending on the softwares you installed, they can be same or different. Although you always use commands in your shell, but they actually have nearly nothing to do with your shell(This even apply to Windows/OS X/*BSD), just learn about how your shell work.



    It's just some distros will default-ly install some common software for you, so you get some common commands available. Like you can use ls on almost all distros just 'cause almost all distros install the linux-utils software for you.



    In some distros, you have more freedom to choose the packages you want, in that case, you may not get ls available if you refuse to install linux-utils or any software that can provide this command. Also notice that different software packages MAY conflict with each other if they provide commands with the same name.






    share|improve this answer


























      up vote
      4
      down vote













      Linux is just a kernel, not OS, things you use directly like commands or GUI programs or beautiful desktops are not provided by the kernel, but by userland components, which are distributed with OSes.



      Commands you used in the shell comes from shell builtin functions or external software package. Depending on the softwares you installed, they can be same or different. Although you always use commands in your shell, but they actually have nearly nothing to do with your shell(This even apply to Windows/OS X/*BSD), just learn about how your shell work.



      It's just some distros will default-ly install some common software for you, so you get some common commands available. Like you can use ls on almost all distros just 'cause almost all distros install the linux-utils software for you.



      In some distros, you have more freedom to choose the packages you want, in that case, you may not get ls available if you refuse to install linux-utils or any software that can provide this command. Also notice that different software packages MAY conflict with each other if they provide commands with the same name.






      share|improve this answer
























        up vote
        4
        down vote










        up vote
        4
        down vote









        Linux is just a kernel, not OS, things you use directly like commands or GUI programs or beautiful desktops are not provided by the kernel, but by userland components, which are distributed with OSes.



        Commands you used in the shell comes from shell builtin functions or external software package. Depending on the softwares you installed, they can be same or different. Although you always use commands in your shell, but they actually have nearly nothing to do with your shell(This even apply to Windows/OS X/*BSD), just learn about how your shell work.



        It's just some distros will default-ly install some common software for you, so you get some common commands available. Like you can use ls on almost all distros just 'cause almost all distros install the linux-utils software for you.



        In some distros, you have more freedom to choose the packages you want, in that case, you may not get ls available if you refuse to install linux-utils or any software that can provide this command. Also notice that different software packages MAY conflict with each other if they provide commands with the same name.






        share|improve this answer














        Linux is just a kernel, not OS, things you use directly like commands or GUI programs or beautiful desktops are not provided by the kernel, but by userland components, which are distributed with OSes.



        Commands you used in the shell comes from shell builtin functions or external software package. Depending on the softwares you installed, they can be same or different. Although you always use commands in your shell, but they actually have nearly nothing to do with your shell(This even apply to Windows/OS X/*BSD), just learn about how your shell work.



        It's just some distros will default-ly install some common software for you, so you get some common commands available. Like you can use ls on almost all distros just 'cause almost all distros install the linux-utils software for you.



        In some distros, you have more freedom to choose the packages you want, in that case, you may not get ls available if you refuse to install linux-utils or any software that can provide this command. Also notice that different software packages MAY conflict with each other if they provide commands with the same name.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 28 at 4:32

























        answered Sep 28 at 4:18









        神秘德里克

        285112




        285112




















            up vote
            3
            down vote













            How a command line is interpreted depends on the shell that is running and how the called program interprets its arguments.



            There's a number of different shells, and a command line using a particular feature of one shell may not work on another shell.



            That said, in general, the various Linux distros all include at least the same basic shells, so if you can make sure you are executing the same shell, you can use the same command line. (That's why in shell scripts you usually put the needed shell in the first line).



            Edit



            Look at the shell scripts e.g. in old-style /etc/init.d, and each of those starts with



            #!/bin/sh


            So these expect some sort of standard shell, which e.g. on Debian is provided by dash. To compare, the shell scripts I write for myself start with



            #!/bin/bash


            because I sometimes use bash extensions. There's a ton of other shells, see e.g. here






            share|improve this answer






















            • Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
              – Kaung Sett
              Sep 29 at 15:16














            up vote
            3
            down vote













            How a command line is interpreted depends on the shell that is running and how the called program interprets its arguments.



            There's a number of different shells, and a command line using a particular feature of one shell may not work on another shell.



            That said, in general, the various Linux distros all include at least the same basic shells, so if you can make sure you are executing the same shell, you can use the same command line. (That's why in shell scripts you usually put the needed shell in the first line).



            Edit



            Look at the shell scripts e.g. in old-style /etc/init.d, and each of those starts with



            #!/bin/sh


            So these expect some sort of standard shell, which e.g. on Debian is provided by dash. To compare, the shell scripts I write for myself start with



            #!/bin/bash


            because I sometimes use bash extensions. There's a ton of other shells, see e.g. here






            share|improve this answer






















            • Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
              – Kaung Sett
              Sep 29 at 15:16












            up vote
            3
            down vote










            up vote
            3
            down vote









            How a command line is interpreted depends on the shell that is running and how the called program interprets its arguments.



            There's a number of different shells, and a command line using a particular feature of one shell may not work on another shell.



            That said, in general, the various Linux distros all include at least the same basic shells, so if you can make sure you are executing the same shell, you can use the same command line. (That's why in shell scripts you usually put the needed shell in the first line).



            Edit



            Look at the shell scripts e.g. in old-style /etc/init.d, and each of those starts with



            #!/bin/sh


            So these expect some sort of standard shell, which e.g. on Debian is provided by dash. To compare, the shell scripts I write for myself start with



            #!/bin/bash


            because I sometimes use bash extensions. There's a ton of other shells, see e.g. here






            share|improve this answer














            How a command line is interpreted depends on the shell that is running and how the called program interprets its arguments.



            There's a number of different shells, and a command line using a particular feature of one shell may not work on another shell.



            That said, in general, the various Linux distros all include at least the same basic shells, so if you can make sure you are executing the same shell, you can use the same command line. (That's why in shell scripts you usually put the needed shell in the first line).



            Edit



            Look at the shell scripts e.g. in old-style /etc/init.d, and each of those starts with



            #!/bin/sh


            So these expect some sort of standard shell, which e.g. on Debian is provided by dash. To compare, the shell scripts I write for myself start with



            #!/bin/bash


            because I sometimes use bash extensions. There's a ton of other shells, see e.g. here







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Sep 29 at 17:23

























            answered Sep 28 at 6:09









            dirkt

            15k21032




            15k21032











            • Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
              – Kaung Sett
              Sep 29 at 15:16
















            • Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
              – Kaung Sett
              Sep 29 at 15:16















            Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
            – Kaung Sett
            Sep 29 at 15:16




            Could you please explain a little bit more on "That's why in shell scripts you usually put the needed shell in the first line" ? I didn't get it.
            – Kaung Sett
            Sep 29 at 15:16


            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay