Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Using the Linux folder wc statistics number of lines of code for all files (including subdirectories)     - ASM Management - How to Rename diskgroup (Database)

- How to import JNI resulting .so libraries in Android Studio (Programming)

- 10 useful Linux command Interview Questions and Answers (Linux)

- Oracle bug Ora-04043 (Database)

- Usage sed some of the parameters (Linux)

- Gitolite how to import other Git repositories (Server)

- Mumble installation source VoIP application on Ubuntu (Linux)

- MySQL migration tool used in the production environment (Database)

- The execution order of Oracle WHERE condition is not from right to left (Database)

- Linux System Getting Started Learning: compile and install ixgbe driver in Ubuntu or Debian (Linux)

- How to build a custom exclusive Ubuntu Live CD (Linux)

- Linux and Windows virtual machine shared folders ---- Linux install VMware tools (Linux)

- You need to know 12 Git High Command (Linux)

- Fast Learning Clojure (Programming)

- To create a problem by the statement date comparison of the difference between MySQL and Oracle (Database)

- Git commands (Linux)

- DataGuard add temporary data files bug (Database)

- Linux system started to learn: how to view the contents of the seed on the Linux file (Linux)

- Python Flask environment to build (Linux)

- Java proxy use and proxy principle (Programming)

  Using the Linux folder wc statistics number of lines of code for all files (including subdirectories)
  Add Date : 2017-04-13      
  The number of rows wc command to count the contents of the file, the number of words, the number of letters. But if you want to count the number of rows in a directory of all files, wc recursion does not provide statistics.

However, you can combine the find command, for example:

$ Wc -l `find -name * .c`

Wherein, -l parameter statistics the number of rows, find -name * .c is to find the current directory (including subdirectories) and all C files, `` is a shell replacement command.

Of course, there are many methods to achieve, I just think this is relatively simple and easy to remember.

Finally, with the use of what wc help (man wc)

      wc - print newline, word, and byte counts for each file

      wc [OPTION] ... [FILE] ...
      wc [OPTION] ... --files0-from = F

      Print newline, word, and byte counts for each FILE, and a total line if more than one FILE is specified With no FILE, or when FILE is -.., Read standard input A word is a non-zero-length sequence
      of characters delimited by white space The options below may be used to select which counts are printed, always in the following order:. newline, word, character, byte, maximum line length.

      -c, --bytes
              print the byte counts

      -m, --chars
              print the character counts

      -l, --lines
              print the newline counts

      --files0-from = F
              read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input

      -L, --max-Line-length
              print the length of the longest line

      -w, --words
              print the word counts

      --help display this help and exit

              output version information and exit
- HttpClient Tutorial (Programming)
- Android custom slideshow menu slidmenu (Programming)
- Cobbler batch install Ubuntu / CentOS system (Linux)
- Grading defense against Linux server attacks (Linux)
- How to Install Suricata IDS on a Linux system (Server)
- About Hibernate cache, you want the latest data have trouble even session.clear (Database)
- Linux system performance analysis and top command ps.pstree Comments (Linux)
- Joseph Central Java implementation (Programming)
- Win8 mount disk partitions under Ubuntu (Linux)
- Setting Hibernate connection MySQL database connection pool coding (Database)
- To compile install and test Swift under Linux (Linux)
- OpenNMS separate database (Server)
- Alien Magic: RPM and DEB Mutual Convert (Linux)
- Ubuntu upgrade to Linux Kernel 4.2.3 Kernel (Linux)
- CentOS install video converter FFmpeg and cutting tools segmenter (Linux)
- Java proxy use and proxy principle (Programming)
- Use SocketServer write a sockets program (Programming)
- RHEL7.0 environment Linux kernel upgrade (Linux)
- The method to mount the CD under Linux (Linux)
- SendMail version of Java implementation with attachments (Programming)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.