Hi Everyone,

I need help with my assignment but i only require assistance to give me some guidance on the issue.

I need to write code in c linux programming, that can change directory [CD]. when you open the command prompt in the linux machine, you type cd .. or something then it will change the current working directory. Can i ask how do i do that in c programming?

Thank you for reading my post. Please let me know if my question isn't clear.

Recommended Answers

All 2 Replies

int chdir(const char *path);

You can use chdir() which is in the unistd.h header file.

commented: Thanks!~ +2

Thank you for your guidance @gerard4143.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.