To create the workspace folder and do the initial setup,
mkdir -p ~/<workspace_name>/srcAs an example (we will be using this workspace from here on),
mkdir -p ~/ros_workshop/srcEnter the workspace and build it.
cd ~/ros_workshop/catkin buildTo create a package
cd ~/ros_workshop/srccatkin_create_pkg <package_name> [depend1] [depend2] [depend3]As an example,
catkin_create_pkg session2_tutorials std_msgs rospy roscppTo build the package,
catkin buildNote : Catkin build command gives a abstract view of the build process or incase it does not work,
catkin_makecommand can be used. It comes as an inbuilt tool with ROS and gives a detailed output on the build process.
To setup new environment variables,
source devel/setup.bash