Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 10-01-2004, 02:46 PM   #1
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Rep: Reputation: 30
where is command "cd" located? or is it a command/ system call?

as above
Old 10-01-2004, 02:49 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,041
Blog Entries: 11

Rep: Reputation: 907Reputation: 907Reputation: 907Reputation: 907Reputation: 907Reputation: 907Reputation: 907Reputation: 907
Neither ... it's a shell-builtin.

man bash (tcsh, ksh ... )
for details

Old 10-01-2004, 03:20 PM   #3
Registered: Oct 2003
Location: Mississauga, ON
Distribution: Ubuntu 9.04
Posts: 494

Rep: Reputation: 30
It's a built-in command so it doesn't have its own file. As the previous poster mentioned, it's part of the "bash" command line program. (Bash stands for "Bourne Again Shell").
Old 10-01-2004, 05:36 PM   #4
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,265

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
Random note: the cd shell builtin uses the chdir system call to accomplish its task. Up until about the sixth edition of Unix (sometime in the mid '70s) the change directory command in the Bourne shell was 'chdir' too. I think cd is easier to type .
Old 10-01-2004, 06:10 PM   #5
Registered: Dec 2003
Location: NC, US
Distribution: Novell Linux Eval (2.6.5)
Posts: 240

Original Poster
Rep: Reputation: 30
that makes sense now, i just wrote a little shell myself, everything (well not everything technically) works but cd doesn't not work, i guess i need to write it on my own then.
Old 10-01-2004, 08:01 PM   #6
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,570

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
By the way, cd used to be an executable on the very early Unix times (late sixties), but was broken just after the fork system call was added to the system.
Here is an excerpt from
Although the multiple-process idea slipped in very easily indeed, there were some aftereffects that weren't anticipated. The most memorable of these became evident soon after the new system came up and apparently worked. In the midst of our jubilation, it was discovered that the chdir (change current directory) command had stopped working. There was much reading of code and anxious introspection about how the addition of fork could have broken the chdir call. Finally the truth dawned: in the old system chdir was an ordinary command; it adjusted the current directory of the (unique) process attached to the terminal. Under the new system, the chdir command correctly changed the current directory of the process created to execute it, but this process promptly terminated and had no effect whatsoever on its parent shell! It was necessary to make chdir a special command, executed internally within the shell. It turns out that several command-like functions have the same property, for example login.

Copyright 2004 Lucent Technologies. All rights reserved.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
About SElinux: enter "setenforce 0",system complains bad command aladin Linux - Software 3 08-21-2005 08:16 PM
"grep" Command (SystemV/68 system) xtremexp Other *NIX 3 05-28-2005 07:25 PM
My system freezes after I issue the "modprobe ndiswrapper" command. markjc Linux - Wireless Networking 1 08-24-2004 09:47 AM
Benoit's Alcatel - pppd call adsl "command not found" GM287 Linux - Networking 5 04-04-2004 09:56 AM
Doing "make" command makes system freeze weiss Linux - Newbie 16 10-09-2003 08:26 AM

All times are GMT -5. The time now is 10:40 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration