ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Command for creating new file / document

asked 2018-11-17 05:19:09 -0500

OsManiaC gravatar image


I couldn't create a new file in a folder using ros command line in terminal. Is there any /roscommand for that?

  • I can easily create in explorer for new document
  • I can easily create in cpp or python ide.
  • I just want to see if I can create without leaving the terminal
edit retag flag offensive close merge delete



Does touch <filename> do what you want?

This doesn't seem like a ROS question though.

gvdhoorn gravatar image gvdhoorn  ( 2018-11-17 05:27:46 -0500 )edit

Thank you, As I mentioned in my question I tried to find if there was a ros command for that. It seems there is not. gedit new_file just works well. Also vi works somehow

OsManiaC gravatar image OsManiaC  ( 2018-11-18 23:35:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-19 01:56:06 -0500

gvdhoorn gravatar image

Afaik, there is no "ROS command" to create a new file.

I also believe that would not be very useful:

  • it would increase maintenance for ROS (core) maintainers
  • managing files is a task for the OS, which has plenty of tools/utilities to do that
  • using existing tools instead of introducing something new allows users to reuse their experience and doesn't invalidate their expectations around such tools

A quick way to create a new file in an arbitrary package (in your workspace of course) could be something like:

rospd <package_name>
touch my_new_file

To then edit that file:

rosed <package_name> my_new_file

See also the rosbash documentation.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-11-17 05:19:09 -0500

Seen: 1,202 times

Last updated: Nov 19 '18