How to change the path of the console

how to change the path of the console

Repl link:

code snippet
1 Like

:wave: Hey, @MadhavKaura welcome to the forums!

Can you please provide a link to the repl? This way it is easier for staff and members of the community to help you!

Also see this guide on how to share your code:

1 Like

You can change the path using cd “the name of the repository” after that is the desired directory.

Hi @MadhavKaura , welcme to the forums!
Are you referring to the file that the Console runs? Or the nix string that appears?

Assuming you are talking about changing the directory the console is accessing at the point, you can use cd to change its directory.
The deepest you can go is root (/), which is not recommended to go to as they are mostly restricted, most of the time the deepest you need to go is runner (~).

You can use cd in this format:

cd ~
#go to runner
cd /
#go to root

Or change the ~ or / to a directory. If you want to change directory easier, you can go to runner, enter ls or dir (basically the same thing, they both show the directories and files in the current directory), choose the one you want to go to, and type cd {directory} where you need to change {directory} into your directory

For more, you can search Linux command guide on the internet, just note that anything requiring sudo cannot be performed here.

Also I see this post is in the Code Help: Python category, everything I provided above is shell command, which you can use

import os
command = 'your command here'
os.system(command)

to run

2 Likes