- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- What is "/usr/bin/cd" for ?
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 07:35 AM
10-24-2001 07:35 AM
Lo and behold the chown command after the above command didn't change the right files.
Of course, I now remember that cd is built-in to the shell, not an executable. What I can't figure out is what the cd script in /usr/bin is useful for? It looks like it shells out and does the cd, then exits that shell, so the parent shell doesn't see the cd. Any explanation what the /usr/bin/cd script is for would be helpful
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 07:42 AM
10-24-2001 07:42 AM
Re: What is "/usr/bin/cd" for ?
It appears to just be a script that calls the shells cd.
# file /usr/bin/cd
/usr/bin/cd: commands text
# cat /usr/bin/cd
#!/usr/bin/sh
# @(#)B.11.11_LR
# This is the executable version of cd implemented using the
# posix shell built-in cd command.
cd "$@"
exit $?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 07:43 AM
10-24-2001 07:43 AM
Re: What is "/usr/bin/cd" for ?
cd is from change directory and it's a posix built-in shell command. The /usr/bin directory has all these built-in commands.
-USA..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 07:43 AM
10-24-2001 07:43 AM
Re: What is "/usr/bin/cd" for ?
What you observed is expected. Take a look at the man pages for 'cd':
"cd exists only as a shell built-in command because a new process is created whenever a command is executed, making cd useless if written and processed as a normal system command. Moreover, different shells provide different implementations of cd as a built-in utility."
Thus, the extenal command exists to provide a standard should the need exist.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 08:03 AM
10-24-2001 08:03 AM
Re: What is "/usr/bin/cd" for ?
when you use "'cd"" - the
shell''s built in CD command
is excuted. It does not
call /usr/bin/cd.
Do this test
# mv /usr/bin/cd /usr/bin/cd.old
# the cd command will still work.
My guess is it is just a wrapper for future compatibility use.
Being a shell builtin, there
is no need to specify the
path of it in your scripts.
-raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-24-2001 08:09 AM
10-24-2001 08:09 AM
Re: What is "/usr/bin/cd" for ?
Can anyone give us a practical use for /usr/bin/cd?
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 01:40 AM
10-25-2001 01:40 AM
Re: What is "/usr/bin/cd" for ?
The cd(1) manual page gives an example with find(1) and its -exec option.
Another, perhaps slightly more useful, example in that manual page is "Another usage of cd as a stand-alone command is to obtain the exit
status of the command.".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 04:01 AM
10-25-2001 04:01 AM
Re: What is "/usr/bin/cd" for ?
V.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 04:32 AM
10-25-2001 04:32 AM
Re: What is "/usr/bin/cd" for ?
Read the manual? And miss all this fun? Just kidding!
Darrell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 04:48 AM
10-25-2001 04:48 AM
Re: What is "/usr/bin/cd" for ?
Thanks for the gentle reminder and the answer.
I have been using cd for quite a while and took the manual and the command for granted.
Just another perplexing day on the job.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 06:46 AM
10-25-2001 06:46 AM
Re: What is "/usr/bin/cd" for ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2001 06:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 08:48 AM
10-29-2001 08:48 AM
Re: What is "/usr/bin/cd" for ?
I did make a mistake when assigning points to your answer. I emailed the forums folks and they say that there is no way to change the point value once it is assigned. I hope by assigning 10 to your latest question, that will rectify the mistake. Sorry about that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2001 10:53 AM
10-29-2001 10:53 AM
Re: What is "/usr/bin/cd" for ?
Thanks
Brian