frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Did early Unix shells ever use `chd` command to change directories?

3•damiaozi•5h ago
I've been exploring early Unix systems, particularly *Unix V0 on the PDP-7* and its successor, *Unix V1 on the PDP-11*, using the SIMH emulator.

Interestingly, one of the most common modern shell commands, `cd`, did *not* exist in these early versions.

- In *Unix V0*, directory changes were done via a shell command called `ch`, used in combination with a special directory called `dd`(directory directory). For example, to enter Ken's home directory, one would type `ch dd ken`. This seems to reflect that a full hierarchical file structure hadn't been implemented yet. I've verified this behavior in the SIMH emulator.

- In *Unix V1*, the method becomes more familiar: you use `chdir /usr/ken`, though still *not* `cd`. This is also verified on SIMH. Dennis Ritchie mentioned in _"The Evolution of the Unix Time-sharing System"_:

> "Incidentally, _chdir_ was spelled _ch_; why this was expanded when we went to the PDP-11 I don't remember."

Now here's where it gets curious:

While reading the [Unix V0 shell source code (`pbsh.s`)](https://github.com/DoctorWkt/pdp7-unix/blob/master/src/other/pbsh.s#L199C1-L210C18), I found something that seems to check for a built-in command matching the string `"chdir"` — but compares the first 3 characters, NOT 2 or 5:

```asm " https://github.com/DoctorWkt/pdp7-unix/blob/master/src/other/pbsh.s#L199C1-L210C18

chdirstr: <ch>;<di>;<r 040

. . . . . .

" check for built-in "chdir" command lac argv0 sad chdirstr skp jmp 1f lac argv0+1 sad chdirstr+1 skp jmp 1f lac argv0+2 sad chdirstr+2 jmp changedir ```

This logic suggests it would match a string like `chd` — since only the first 3 characters are compared (`argv0`, `argv0+1`, `argv0+2`).

However, when running the Unix V0 in SIMH, I can only get `ch` to work — `chd` doesn't appear to be recognized as a command. This seems contradictory with what the shell source implies.

Has anyone seen `chd` documented or working in early Unix shells?

Would love to hear from others who have explored this layer of Unix archaeology.

Comments

GianFabien•4h ago
I vaguely recollect that in Unix v5 as distributed to universities by Western Electric in 1976, there was a chdir command. Which if only the first 3 chars were compared would have been like chd. But that's almost a half a century ago ... memories do get corrupted, e.g. by CP/M.

Sandboxed Python executor for AI agents using WebAssembly

https://psiace.me/posts/2025-07-08-wasmtime-executor-for-code-agents/
1•freediver•46s ago•0 comments

Chinese University Expels Woman for 'Improper Contact' with a Foreigner

https://www.nytimes.com/2025/07/14/world/asia/chinese-student-expelled-privacy.html
1•mistersquid•1m ago•0 comments

India wants air conditioners to be made with milder temp settings to save energy

https://apnews.com/article/india-climate-change-extreme-heat-air-conditioners-29dc15ba12cb4142e0670ca8466ba61f
1•sandbach•4m ago•0 comments

Magnets Could Become the Next Generation of Gravitational Wave Detectors

https://www.universetoday.com/articles/magnets-could-become-the-next-generation-of-gravitational-wave-detectors
1•rbanffy•4m ago•0 comments

Ask HN: What's the best way to start with Ruby on rails?

1•bn-l•4m ago•0 comments

Show HN: We launched our website, any feedback please?

https://www.chatwithads.com/
1•Amit404•9m ago•0 comments

Making Immigration Great Again – Paul Krugman

https://paulkrugman.substack.com/p/making-immigration-great-again
1•rbanffy•10m ago•0 comments

Largest Known Mars Meteorite on Earth Will Be Auctioned in New York

https://techoreon.com/largest-known-martian-meteorite-set-for-auction-in-new-york/
1•kypbro•13m ago•0 comments

Is the U.S. Ready for the Next War?

https://www.newyorker.com/magazine/2025/07/21/is-the-us-ready-for-the-next-war
2•pseudolus•14m ago•1 comments

Show HN: HardView – Know Your Hardware Instantly from Python

https://github.com/gafoo173/HardView
2•gafoo1•14m ago•0 comments

Easybudget: The easiest way to track your finances

https://easybudget.ing/
1•mttspss•14m ago•1 comments

Upyo: Simple and modern email sending library for JavaScript

https://upyo.org/
1•todsacerdoti•15m ago•0 comments

How the Deep Sea Cables That Power the World Are Made

https://www.nytimes.com/2025/07/14/business/undersea-power-cables-electricity.html
1•reaperducer•16m ago•0 comments

Google's Gemini refuses to play Chess against the Atari 2600

https://www.theregister.com/2025/07/14/atari_chess_vs_gemini/
1•beardyw•16m ago•0 comments

Air pollution cuts in East Asia likely accelerated global warming

https://phys.org/news/2025-07-air-pollution-east-asia-global.html
1•pseudolus•16m ago•0 comments

My Hobby Is Bikeshedding?

https://log.schemescape.com/posts/misc/my-hobby-is-bikeshedding.html
2•maksimur•17m ago•0 comments

Best 10 Startups to Invest in Australia (2025) – Expert Guide

https://yakkalabour.com.au/best-startups-to-invest/
1•AldrinHood•18m ago•0 comments

Show HN: SafePrompt – iOS app to anonymize docs and manage prompts ($0.99)

https://apps.apple.com/us/app/safeprompt-mobile/id6746164848
1•saschams•20m ago•0 comments

"AI discourse" is a joke

https://purplesyringa.moe/blog/ai-discourse-is-a-joke/
10•bertman•23m ago•3 comments

Will Yakka labour become the next unicorn in Australia?

https://yakkalabour.com.au/
1•AldrinHood•23m ago•0 comments

The LLM-for-software Yo-yo

https://tratt.net/laurie/blog/2025/the_llm_for_software_yoyo.html
2•ingve•23m ago•0 comments

AI bots dismantle paywalls via web search

https://www.digitaldigging.org/p/how-ai-bots-quietly-dismantle-paywalls
1•freediver•27m ago•0 comments

putty.org is not run by the PuTTY developers

https://hachyderm.io/@simontatham/114846017785770922
3•LeoPanthera•27m ago•0 comments

Is the State of the World Causing You Pain?

https://nautil.us/is-the-state-of-the-world-causing-you-pain-1223766/
1•rbanffy•29m ago•0 comments

Show HN: Led Calculator

https://ledcalculator.org/
1•artiomyak•32m ago•0 comments

Facebooks Strategy Tax

https://www.techemails.com/p/mark-zuckerberg-facebook-strategy-tax
1•pploug•33m ago•0 comments

Google confirms it's 'combining' Chrome OS and Android into a single platform

https://www.androidauthority.com/google-combine-chrome-os-android-3577035/
1•tambourine_man•34m ago•1 comments

Blue Pencil no. 18–Some history about Arial

https://www.paulshawletterdesign.com/2011/09/blue-pencil-no-18%e2%80%94some-history-about-arial/
1•Bluestein•34m ago•0 comments

Does Trump's Biggest Crypto Backer Exist?

https://www.thenation.com/article/archive/trump-crypto-world-liberty-financial-aqua-1-foundation/
3•doener•36m ago•0 comments

Arc Virtual Cell Challenge: A Primer

https://fleetwood.dev/posts/virtual-cell-challenge
1•FL33TW00D•36m ago•0 comments