LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 10-01-2004, 02:46 PM   #1
feetyouwell
Member
 
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
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,971
Blog Entries: 11

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

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


Cheers,
Tink
 
Old 10-01-2004, 03:20 PM   #3
vincebs
Member
 
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
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,078

Rep: Reputation: 297Reputation: 297Reputation: 297
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
feetyouwell
Member
 
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
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,490

Rep: Reputation: 355Reputation: 355Reputation: 355Reputation: 355
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 http://cm.bell-labs.com/cm/cs/who/dmr/hist.html
Quote:
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.
 
  


Reply


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 03:36 PM.

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