Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我如何在 Linux 中搜索文件然后报告我找到的那些文件的大小?
例如,我想在 Linux 的主目录中搜索名为 core.txt 的文件,core.txt 也会出现在我的主目录下的某个子目录中。然后在找到 core.txt 之后,该命令还应该显示这些文件的文件大小。
干杯
我们可以使用find命令来查找文件并du -sh找出它的大小。
find
du -sh
我们将对找到的文件执行 du -sh。所以最终的命令是
find ~ -name "core.txt" -exec du -sh {} \; 或者 find ~ -name "core.txt" | xargs du -sh
find ~ -name "core.txt" -exec du -sh {} \;
find ~ -name "core.txt" | xargs du -sh
在第二个命令xargs中将不处理文件名中的空格。所以我们可以告诉 xargs 精确的分隔符来处理文件名中的空格。
xargs
find ~ -name "core.txt" | xargs -d '\n' du -sh
我尝试使用下面的代码来解析 JSON 数据,该网站需要一个 API 密钥,现在它作为字符串存储在我的 strings.xml 中。
public class JSONParser { static InputStream is = null; static JSONArray jarray = null; static String json = ""; // const
1 iphone - Cocos2D / CocosBuilder 纹理图集内存使用
1 java - Java TableModel 实现使程序崩溃
1 facebook - 如何过滤 Graph API 结果(“with”修饰符?)
1 graph - 是否有类似图的树的名称,其中节点可以有多个父节点,但仍然仅来自上一层
Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641