What is this command? roscd;cd ..;cd src in Exercise 2.2.1

Hi, I’m working on Git course.

There was a command roscd;cd ..;cd src in the note for changing folder.

Is this same as cd command?

Hello, let’s break down the sequence:

  1. roscd: This is a ROS-specific command that changes the current directory to a specified ROS package or stack’s directory. In the case of our environment, that would be the ~catkin_ws\devel folder.
  2. cd ..: This command changes the directory to the parent directory of the current one. So, after moving to a ROS package directory with roscd, cd .. would take you up one level in the directory hierarchy, to the catkin_ws folder in this example.
  3. cd src: Finally, this changes the directory to a src subdirectory from the current location.

The roscd command it’s versatile, for example you can use roscd my_pkg to move to a specific package, typically located in ~/catkin_ws/src/my_pkg

1 Like

I see, thank you! It was 3 commands!
Now it easier to understand:)

I didn’t quite get roscd command.

I understand that typing “roscd” only, it will lead me to the ros root directory,
but I tried “roscd devel” like the picture I attatched,
it doesn’t move to the specific directory.

The roscd command it’s versatile, for example you can use roscd my_pkg to move to a specific package, typically located in ~/catkin_ws/src/my_pkg

It sounds like same as cd command, but it’s not?
image

devel is not a package, that’s what the error message is saying. If you must add anything to roscd, it must be a valid package.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.