Linked Questions

0
votes
1answer
650 views

Why is my CD command not working on a home-built shell? [duplicate]

I have written a very basic shell in C. It reads the input, then runs it using system(lineCopy); (lineCopy being a copy of the input). All commands will run fine in it, other than cd. When I try to cd ...
1
vote
0answers
96 views

What is the difference between test, [, and [[ in terms of binary vs. builtin? [duplicate]

It is often written: /usr/bin/test is a synonym for /usr/bin/[ [[ is a bash improvement for [ test and [ are also builtins I understand the difference between [ and [[ but I am confused with the ...
130
votes
7answers
20k views

Why is cd not a program?

I've always wondered why cd isn't a program, but never managed to find the answer. Anyone know why this is the case?
139
votes
4answers
44k views

What exactly is POSIX?

I see POSIX mentioned often and everywhere, and I had assumed it to be the baseline UNIX standard.. until I noticed the following excerpt on a Wikipedia page: The Open Group The Open Group is ...
46
votes
8answers
4k views

Why are POSIX mandatory utilities not built into the shell?

The purpose of this question is to answer a curiosity, not to solve a particular computing problem. The question is: Why are POSIX mandatory utilities not commonly built into shell implementations? ...
82
votes
2answers
54k views

What is the difference between interactive shells, login shells, non-login shell and their use cases? [duplicate]

Possible Duplicate: Difference between Login Shell and Non-Login Shell? I have been looking at /etc/profile. bash.bashrc to see how they are run, and notice that some are executed by non-login ...
27
votes
3answers
6k views

What is the purpose of square bracket executable

I see there is an executable called "[" in /usr/bin. What is its purpose?
19
votes
2answers
5k views

How are system commands like ls created?

I have some doubts regarding *nix. I don't know which type of executable file is ls, whether it is .sh or .ksh or any other kind of system executable if it is, what is that? when I tried to see what ...
11
votes
4answers
447 views

When are the built-in commands loaded to memory

Let's say if I type in cd in my shell. Is cd loaded from the memory at that moment? My intuition is that these built-in commands are pre-loaded to the system memory after the kernel has been loaded, ...
12
votes
2answers
2k views

Understanding shell builtin commands

In in the bash manual, it's written that Builtin commands are contained >>> within <<< the shell itself Also, this answer states that A built-in command is simply a command that ...
8
votes
2answers
4k views

Differences between keyword, reserved word, and builtin?

From Make bash use external `time` command rather than shell built-in, Stéphane Chazelas wrote: There is no time bash builtin. time is a keyword so you can do for instance time { foo; bar; } We ...
3
votes
2answers
815 views

Edit tree to output in custom format?

I'd like to get a custom output from the tree command, but unlike this question, I don't have a fixed format. I'd like to be able to give the command the format in an argument (for instance perhaps -f=...
3
votes
1answer
613 views

strace works for some builtin commands

I'm trying to understand some kernel level concepts in Linux. I was checking on the difference between shell builtin commands and the other executable commands. This wonderful answer clearly tells ...
5
votes
1answer
110 views

What are the main execution stages in Linux (how does a program basically gets executed in Linux)?

I understand that there are two stages of execution in Linux, dealing with every command we run. I'll name this how I understand them because I don't know the original phrasing: Shell handling --- ...
2
votes
1answer
129 views

CD with redirect to logger does not work

On Linux, the following cd works fine so cds into tmp: / # cd /tmp tmp # But this does not work (stays at root, nothing appears in /var/log/messages). Why not? / # cd /tmp 2>&1 | /usr/bin/...

15 30 50 per page