{"version":"1.0","author_name":"saneeeatsu","type":"rich","blog_url":"https://saneeeatsu.hatenablog.com/","provider_name":"Hatena Blog","url":"https://saneeeatsu.hatenablog.com/entry/file-random-sampling-command","provider_url":"https://hatena.blog","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsaneeeatsu.hatenablog.com%2Fentry%2Ffile-random-sampling-command\" title=\"\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3057\u3066\u5225\u306e\u30d5\u30a9\u30eb\u30c0\u3078\u30b3\u30d4\u30fc\u3057\u305f\u3044 - \u6a5f\u68b0\u97f3\u75f4\u306a\u60c5\u5831\u7cfb\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","image_url":null,"height":"190","description":"\u53d6\u308a\u6562\u3048\u305a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u52d5\u304b\u3059\u305f\u3081\u306b\u3001\u5168\u3066\u306e\u753b\u50cf\u304c\u5165\u3063\u3066\u3044\u308b\u30d5\u30a9\u30eb\u30c0\u304b\u3089\u3001 \u5b66\u7fd2\u7528\u3001\u30c6\u30b9\u30c8\u7528\u306e\u30d5\u30a9\u30eb\u30c0\u306b\u30e9\u30f3\u30c0\u30e0\u306b\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3057\u3066\u79fb\u52d5\u3055\u305b\u305f\u3044\u3002 find ./FROM_DIR/ | grep *.jpg | sort -R | tail -n NUM | xargs -n 1 sh -c 'cp -v $0 ./TO_DIR' \u30b3\u30de\u30f3\u30c9 \u8aac\u660e find ./FROM_DIR/ FROM_DIR\u4ee5\u4e0b\u306b\u3042\u308b\u30d5\u30a1\u30a4\u30eb\u30fb\u30d5\u30a9\u30eb\u30c0\u3092\u3059\u3079\u3066\u5217\u6319 grep *.jpg \u301c.jpg\u3068\u306a\u3063\u3066\u3044\u308b\u30d5\u30a1\u30a4\u30eb\u3092\u691c\u7d22 sort -R \u30e9\u30f3\u30c0\u30e0\u306b\u4e26\u3073\u66ff\u3048 tail -n NUM NUM\u500b\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u53d6\u5f97 xargs -n\u2026","categories":["\u3061\u3087\u3044\u30e1\u30e2"],"published":"2018-09-22 16:57:40","blog_title":"\u6a5f\u68b0\u97f3\u75f4\u306a\u60c5\u5831\u7cfb","title":"\u30d5\u30a9\u30eb\u30c0\u5185\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30e9\u30f3\u30c0\u30e0\u306b\u30b5\u30f3\u30d7\u30ea\u30f3\u30b0\u3057\u3066\u5225\u306e\u30d5\u30a9\u30eb\u30c0\u3078\u30b3\u30d4\u30fc\u3057\u305f\u3044","width":"100%","author_url":"https://blog.hatena.ne.jp/saneeeatsu/"}