不能够运行grep命令 [英] Not able to run grep command

查看:239
本文介绍了不能够运行grep命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图运行下面的命令,

I was trying to run the following instruction,

 Process p = Runtime.getRuntime().exec("/system/bin/lsof|grep mediaserver");

在安卓(JAVA),但我得到的错误。如果我运行下面的指令,

In android(java) but I am getting error. if I run following instruction,

 Process p = Runtime.getRuntime().exec("/system/bin/lsof ");

该文件是成功saved.Can谁能告诉什么是错误?其实我想列出,并检查是否媒体服务器服务正在运行与否。

the file is successfully saved.Can anyone tell what is the error? Actually I want to list and check if media server service is being running or not.

推荐答案

grep工具可能无法安装在设备上。

The grep utility may not be installed on your device.

您可以通过在控制台尝试以下检查:

You can check it by trying the following in a console:

> adb shell
$ grep
grep: not found

最后一行表示该命令不可用。

The last line indicates that this command is not available.

这篇关于不能够运行grep命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆