Linked Questions

1
vote
0answers
407 views

What is `/usr/bin/cd`? [duplicate]

I suggested using which to confirm whether a command works only as a shell builtin or alias. cd is an example of a command that works as a shell builtin. It would be much harder to implement the ...
0
votes
1answer
180 views

What differences between `type cd` and `which cd` commands in linux? [duplicate]

What differences between two below commands in CentOS7? $ type cd cd is a shell builtin and $ which cd cd is a shell builtin cd is /usr/bin/cd cd is /bin/cd The cd is a shell builtin command, but ...
102
votes
11answers
22k views

Does cd . have use?

One of the tutorials I've been following briefly stated that cd . has no use. When trying to replicate issue shown by OP in Symbolic link recursion - what makes it “reset”?, I also tried cd ., which ...
34
votes
6answers
32k 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 ...
27
votes
6answers
5k 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) ...
26
votes
4answers
10k views

How do you enter a directory that's name is only a minus?

I downloaded lessn to my webserver and unzipped it. It contains a folder named -. I assumed I know how to deal with that, but I don't. I tried cd -- -, but that doesn't have the desired effect. ...
14
votes
6answers
3k views

Why does “ls” require a separate process for executing?

Why does ls require a separate process for its execution? I know the reason why commands like cd can't be executed by forking mechanism but is there any harm if ls is executed without forking?
7
votes
5answers
2k views

$ find -exec cd => gives error: => find: ‘cd’: No such file or directory

When I run this command it works: $ find . -inum 888696 -exec ls '{}' \; Conversation.pst Outlook Data File Outlook Data File.sbd Trash Unsent Messages Inbox.pst Outlook Data File.msf ...
6
votes
3answers
3k 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 -...
18
votes
2answers
1k views

Why does POSIX require certain shell built-ins to have an external implementation?

From this question about whether printf is a built-in for yash, comes this answer that quotes the POSIX standard. The answer points out that the POSIX search sequence is to find an external ...
9
votes
2answers
932 views

What languages are used to build Unix commands?

Examples of commands I'm referring to are ls, pwd, and cd. Also, how are these built? Do you have an example?
-2
votes
1answer
86 views

Does a shell builtin command actually run the program from its path?

I was reading the marked answer from here : What is the difference between a builtin command and one that is not? Here he says : A built-in command is simply a command that the shell carries out ...
3
votes
0answers
65 views

How little work could `/usr/bin/cd` or `/usr/bin/wait` do and still be conforming?

Can the executables with the same names as shell builtins get away with doing a lot less "work" than the shell builtins do? For instance, could the fg executable just exit abnormally immediately? ...