i wanna ask how to read from a file and give a summery of letter count (separate small than capital letters),number of line ,number of paragraphs,number of quoted sentenses ?
i know the number of lines by (wc -l) but the others i woundered about !! hope somebody teach me :) thx

Recommended Answers

All 6 Replies

I dont think you can do all that using default packages but "wc" do other things then counting lines(-l). run this command: "man wc" and it will teach you :).
You can use "man" for almost every commnd. It gives you the information and almost everything about a command, try that...

Explore options of wc. Hope you found the correct option.

thank you :) its work ;)...
but i wanna ask how to Search the current directory for any files that were created before a given date (as a user input) !!!

I could be wrong, but I don't think any file systems on Linux store the creation date. Though you could check for the modify/change date with the command stat. This code seems to work for me. But the user has to specify the date the same as stat, (yyy-mm-dd).

#!/bin/bash

find . -type f | while read file;
do
modifyDate=`stat $file | grep ^Modify | cut -d' ' -f2`
if [ $1 = $modifyDate ]; then
  echo $file
fi
done;

chris.stout's solution searches every file you've got... icluding those in subdirectories.
Replace his "find . type f" by "ls" and you'll get matching dated files in the current direcory.

ls -ltr
lists the files in the current directory with the latest ones last and including the last modification time. You may be
able to eyeball the date and so the files above that date.

In a script ... there was a trickie way to use find but I forget how it works.

Dumbledor's right. If you wanted to use find, line 3 should be:

find -maxdepth 1 . -type f | while read file;
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.