cd(3tcl)

πŸ“¦
version 9.0.4 Β· 2 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– cd β€” bestie, let's go home (or literally anywhere)

okay so this is cd, one of the Tcl built-in commands, and it's giving main character energy because it's the one that moves you around the filesystem. manual name is cd(3tcl), Tcl Built-In Commands, and yes you already use this one every single day. slay. ✨


🌸 SYNOPSIS 🌸

cd ?dirName?

that's it. that's the whole vibe. one optional argument. iconique. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So basically: cd changes the current working directory to dirName. That's the whole job. 🫢

But wait β€” what if you don't give it a dirName at all? Then it's like, "fine, I'll go home," and it changes to your home directory, which is specified in the HOME environment variable. no cap.

And what does it hand back to you? An empty string. That's the return value. nothing. silence. a little void. πŸ’€

⚠️ important bestie, do NOT skip this: the current working directory is a per-process resource. Which means when you cd, you're not just moving yourself β€” the cd command changes the working directory for all interpreters and all threads. every single one. the whole process is coming with you. it's a group trip, not a solo vacation. 🌈

✨ EXAMPLES ✨

1. Go to the home directory of the user fred:

cd [file home fred]

2. Go to the directory lib, which is a sibling directory of the current one:

cd ../lib

see? .. up, then over. lowkey the most useful trick in the whole game. πŸŽ€


πŸ‘‘ SEE ALSO πŸ‘‘


πŸ’œ KEYWORDS πŸ’œ

  • working directory

that's the whole page, bestie. go forth and change directories responsibly. obsessed with you. πŸ¦‹πŸ’–

this has been cd(3tcl) from the Tcl built-in commands crew β€” mwah, periodt, see you in the next directory. πŸŽ€βœ¨

πŸ“¦ where this page comes from