reading file
Actually i want to use the files in current directory to do wc on each file. I tried wc -wl * . But it prints out the subdirectories and files too. So i want to use for loop . but havent used it before. so if someone can help me with that. how can i read files from current working directory in for loop.?
-Thanks |
exactly What do you want to do?
can you just explain it properly? |
I guess following command will do you work:-
Terminal$ wc -wl *.* hope it helps you. |
That will only work with files that have file extensions.
I recommend to use find for this problem Code:
find . -type f -maxdepth 1 -exec wc -l '{}' \; For more info about the find command have a look at Code:
man find |
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate. Please, follow discussion here: http://www.linuxquestions.org/questi...les-4175431040
|
All times are GMT -5. The time now is 12:00 PM. |