Do all different Linux OS have the same command lines?
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
Do all different Linux OS have the same command lines? What I want to know is the same command line works for all kinds of Linux OS (CentOS, Fedora, Ubuntu, etc) or they all have different command lines for each OS?
linux command-line
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
Do all different Linux OS have the same command lines? What I want to know is the same command line works for all kinds of Linux OS (CentOS, Fedora, Ubuntu, etc) or they all have different command lines for each OS?
linux command-line
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Do all different Linux OS have the same command lines? What I want to know is the same command line works for all kinds of Linux OS (CentOS, Fedora, Ubuntu, etc) or they all have different command lines for each OS?
linux command-line
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Do all different Linux OS have the same command lines? What I want to know is the same command line works for all kinds of Linux OS (CentOS, Fedora, Ubuntu, etc) or they all have different command lines for each OS?
linux command-line
linux command-line
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
edited 3 hours ago


Pierre.Vriens
94841015
94841015
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 4 hours ago


Kaung Sett
226
226
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Kaung Sett is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
5
down vote
accepted
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 implementation, 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.
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
19 mins ago
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
16 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@ 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
10 mins ago
add a comment |Â
up vote
2
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.
add a comment |Â
up vote
2
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).
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
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 implementation, 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.
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
19 mins ago
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
16 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@ 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
10 mins ago
add a comment |Â
up vote
5
down vote
accepted
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 implementation, 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.
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
19 mins ago
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
16 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@ 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
10 mins ago
add a comment |Â
up vote
5
down vote
accepted
up vote
5
down vote
accepted
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 implementation, 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.
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 implementation, 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.
edited 30 mins ago
answered 1 hour ago


Kusalananda
107k14209331
107k14209331
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
19 mins ago
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
16 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@ 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
10 mins ago
add a comment |Â
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
19 mins ago
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
16 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@ 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
10 mins ago
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
19 mins ago
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
19 mins ago
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
16 mins ago
@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
16 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@KaungSett An example of what you're thinking of would be nice. It's all very generic otherwise.
– Kusalananda
15 mins ago
@ 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
10 mins ago
@ 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
10 mins ago
add a comment |Â
up vote
2
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.
add a comment |Â
up vote
2
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.
add a comment |Â
up vote
2
down vote
up vote
2
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.
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.
edited 3 hours ago
answered 3 hours ago
神秘德里克
19410
19410
add a comment |Â
add a comment |Â
up vote
2
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).
add a comment |Â
up vote
2
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).
add a comment |Â
up vote
2
down vote
up vote
2
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).
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).
answered 1 hour ago
dirkt
14.9k2932
14.9k2932
add a comment |Â
add a comment |Â
Kaung Sett is a new contributor. Be nice, and check out our Code of Conduct.
Kaung Sett is a new contributor. Be nice, and check out our Code of Conduct.
Kaung Sett is a new contributor. Be nice, and check out our Code of Conduct.
Kaung Sett is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f471975%2fdo-all-different-linux-os-have-the-same-command-lines%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password