ubuntu Ros log文件清理

由于需要使用Ros不慎入了Ubuntu的坑,从此一去不复回,除了一些特殊情况很少再用windows。使用半年期间,/home目录常常出现空间不足。也查不到文件信息。今天才发现是由于ros的日志文件占用了36G空间。今天介绍下清理办法。

在terminal中输入

$ rosclean check
348K ROS node logs
20K rosmake logs

查看日志占用情况。

$ rosclean purge
Purging ROS node logs.
PLEASE BE CAREFUL TO VERIFY THE COMMAND BELOW!
Okay to execute:

rm -rf /u/username/.ros/log
(y/n)?

警告以上命令会从磁盘删除文件。

rosclean purge 是清理日志文件的哦!!!输入后输入y就能自动清理啦!

WARNING: use with care. This will delete files from disk!

rosclean purge will remove directories associated with storing ROS-related log files. You will be asked to confirm each deletion and it is important that you verify the command that rosclean purge executes is correct. Otherwise you may lose important files.

另外介绍一下使用 du -sh 命令查看Ubuntu硬盘文件使用情况。

12G /home/shawn

root@ubuntu:/home# du -sh /home/shawn/*

8.0K /home/shawn/atom:

172M /home/shawn/Desktop

4.0K /home/shawn/Documents

72M /home/shawn/Downloads

12K /home/shawn/examples.desktop

4.0K /home/shawn/Music

460K /home/shawn/Pictures

4.0K /home/shawn/Public

4.0K /home/shawn/Templates

4.0K /home/shawn/text.log

4.0K /home/shawn/Videos

猜你喜欢

转载自blog.csdn.net/dddxxxx/article/details/81412846
今日推荐