At Linux, how to count the number of lines inside the file has? I don't know what is the easiest and best way, but I know one and I use that one always to count lines from file. Here goes the command.
At this command, using cat command you can output a file content. And using wc -l command, you can count the line. By combining both of them it will do the trick. First the cat will display the whole file content, and by piping(|) the wc -l command, it will count the number of lines from the cat's output content.
May be someone can provide better ideas/solution to do the task.
cat fileName.txt | wc -l
At this command, using cat command you can output a file content. And using wc -l command, you can count the line. By combining both of them it will do the trick. First the cat will display the whole file content, and by piping(|) the wc -l command, it will count the number of lines from the cat's output content.
May be someone can provide better ideas/solution to do the task.
Comments