Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
20
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@day-1

ディレクトリ内のファイル行数をカウントする

試しにGithubからrails-masterをダウンロードして、rbファイルの行数をカウントしてみました。

wc -l `find rails-master/ -name '*.rb'`

結果

(中略)
233 rails-master//railties/test/paths_test.rb
75 rails-master//railties/test/rack_logger_test.rb
56 rails-master//railties/test/rails_info_controller_test.rb
92 rails-master//railties/test/rails_info_test.rb
1244 rails-master//railties/test/railties/engine_test.rb
126 rails-master//railties/test/railties/generators_test.rb
278 rails-master//railties/test/railties/mounted_engine_test.rb
200 rails-master//railties/test/railties/railtie_test.rb
60 rails-master//railties/test/test_info_test.rb
128 rails-master//tasks/release.rb
10 rails-master//version.rb
240824 total

wcコマンドは -lオプションで行数をカウントします。

参考: http://codezine.jp/unixdic/w/wc

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
20
Help us understand the problem. What are the problem?