What is the difference between a Linux shell command and a system call?
-
-
Answer:
In simple terms I would like you to know, shell commands are your requests to the shell, which is in-turn is an interface to the Kernel. The way you order the shell to do stuff via commands, the shell orders/requests the kernel via system calls.
Amar Akshat at Quora Visit the source
Other answers
A https://en.wikipedia.org/wiki/System_call is a function you use within programming languages like C, C++, Python, etc. to access functionality that the system provides through various APIs. For example, http://linux.die.net/man/2/stat is a system call - part of the POSIX standard - but http://linux.die.net/man/3/printf is not a system call - it is part of the C standard library. A shell command has nothing to do with Linux, but is a command that is implemented within the shell by the various shells in use (bash, ksh, csh). For example, bash implements echo, test, cd, but not ls. So echo, test, cd, etc. are shell commands, but ls and http://linux.die.net/man/1/stat are not shell commands. See http://linux.die.net/man/1/bash (the section called Shell Builtin Commands).
Murukesh Mohanan
shell commands are nothing but compiled programs available mostly in /lib/bin directory.You too can write any program,compile it and then either put it in some directory already in PATH env variable or just add the directory containing your program executables in PATH env variable. system calls are operating system functions handled by os/kernel.These calls are used to access functionalities provided by os. The system calls are costly so there are lots of API available which does same task efficiently.
Amrit Singh
There is one more difference when you execute a shell command it forks a child process and entire operation is done in a separate process (different address space). On the other side, if you invoke a system call it is executed in the address space of the calling process. Performance wise using system call is more efficient.
Avinash Bhardwaj
Related Q & A:
- What's the difference between a US version PSP and a Japan version PSP?Best solution by Yahoo! Answers
- What's the difference between a regional sales manager and a senior sales executive?Best solution by Yahoo! Answers
- What is the difference between a digital TV tuner and a built in TV tuner?Best solution by Yahoo! Answers
- What is the difference between a high pitch voice and a tenor timbre?Best solution by Yahoo! Answers
- What is the difference between a B.S. and B.A. in psychology?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.