Linked Questions

32
votes
6answers
28k views

where is `cd` located? [duplicate]

In a bash sub shell I get the following error when running cd sudo: cd: command not found This is expected because I don't have a path. Usually to work around this I just provide the full path like ...
6
votes
2answers
3k views

Why is cd not a file in /bin? [duplicate]

Possible Duplicate: Why is cd not a program? I noticed that every other commonly used util, like ls, cp, rm, etc. are actually files in /bin -- but cd is not. Nor is it in any other binaries dir ...
0
votes
1answer
54 views

basic linux executable path does not show up [duplicate]

I am trying to find the path of basic commands like ls or cd using which command. I see the path for ls but not for cd. Of course both the commands work fine. Any idea? $ which ls /bin/ls $ which cd $...
0
votes
2answers
28 views

Can I create my own command in python? [duplicate]

Suppose I have command like cd abc/def, So I want to create own command like 'a'. If I run 'a' command it ,should run command cd abc/def optiplex-3020:~$ a So could it be possible and I want to use ...
164
votes
6answers
56k views

What is the difference between the Bash operators [[ vs [ vs ( vs ((?

I am a little bit confused on what do these operators do differently when used in bash (brackets, double brackets, parenthesis and double parenthesis). [[ , [ , ( , (( I have seen people use them on ...
62
votes
4answers
7k views

Why is `[` a shell builtin and `[[` a shell keyword?

As far as I know, [[ is an enhanced version of [, but I am confused when I see [[ as a keyword and [ being shown as a builtin. [root@server ~]# type [ [ is a shell builtin [root@server ~]# type [[ [[ ...
70
votes
4answers
20k views

What is the difference between a builtin command and one that is not?

Is there any intrinsic difference between a builtin command and another command which can nominally do the same thing? eg. Do builtins get "special" treatement? ... is there less overhead running ...
33
votes
6answers
11k views

Why is echo a shell built in command?

$ which echo echo: shell built-in command. $ which ls /bin/ls $ which cat /bin/cat Why is echo not an independent utility like ls, ps, cat etc? Why is it shell specific? Any good reasons?
26
votes
6answers
4k views

Why can't I redirect a path name output from one command to “cd”?

I am trying to get cd to accept a directory name redirected to it from another command. Neither of these methods work: $ echo $HOME | cd $ echo $HOME | xargs cd This does work: $ cd $(echo $HOME) ...
12
votes
8answers
12k views

Why is the terminal case-sensitive?

When I do - CD .. instead of cd .. it gives me error saying - CD: command not found Why is the terminal case sensitive when it comes to linux commands? I mean you should be able to execute the ...
33
votes
1answer
2k views

Why can Shell builtins not be run with capital letters but other commands can?

Why is this? When I do this CD ~/Desktop It doesn't take me to the Desktop. But this: echo "foo bar" | GREP bar gives me: bar
30
votes
2answers
15k views

What happens when we type a simple command on shell? [duplicate]

I have a simple question regarding the execution of a simple command. As per my understanding, when we type a command such as ls in an interactive shell, Shell interprets the command. Shell creates ...
15
votes
3answers
2k views

Does “sh” have to be in the “/bin” directory?

I have read that POSIX compliant operating systems (for example: Linux) must have the sh shell. But is it required for sh to be in the /bin directory, or can it be in any directory?
6
votes
3answers
2k views

-bash: /bin/cd: No such file or directory - automatically execute ls after cd

I accidentially destroyed my cd command. I tried to automatically execute ls after cd is called. I found a post saying that I have to execute alias cd='/bin/cd && /bin/ls', but now I get -...
1
vote
2answers
30k views

How to change the working directory of invoking shell using a script? [duplicate]

Possible Duplicate: changing current working dir with a script I am trying to create few scripts that would change the working directory of the main shell/terminal. Not able to do so. I tried the ...

15 30 50 per page