find -name \*\.\*\.\* -print
scan said:using grep i need to find lines with only 1 character
scan said:thx.
i have a new problem now.
using grep i need to find lines with only 1 character
iMeowbot said:grep ^.$ filename
Is this school work?
iMeowbot said:grep ^.$ filename
Is this school work?
robbieduncan said:grep '^.$' <filename>
It's just text if followed by space. I love the way the shell parses things, it's clearly the work of sick mindsrobbieduncan said:Damn. You beat me to it. You should quote the search string though as $ is meaningful to the shell...
scan said:lines with only digits
tried: grep [:digit:] * but doesn't work
iMeowbot said:Those character class things are special, even though they have brackets of their own they still need brackets to enclose them.
So:
grep [[:digit:]] *
Or, the more traditional way:
grep [0-9] *
robbieduncan said:Have you considered reading the documentation. Or learning from the previous examples.
grep '^[0-9]*$' <filename>
will print lines that consist of only numbers. You could add whitespace as well if you want.
To do that in one pass, you would probably want to use egrep.scan said:tried that already. the problem is it included lines with digits as well as letters. I need lines with only digits
That will return empty lines toorobbieduncan said:grep '^[0-9]*$' <filename>
will print lines that consist of only numbers.
iMeowbot said:That will return empty lines too![]()
scan said:thanks
i use the man pages but nothing really helped me with this question. We also not given any resources so its kind of "figure it out on your own" type of deal.
savar said:
scan said:How can I use "find" command to list the subdirectories of a directory??
fisty said:dude....
read what i posted....grrrrrrrrrrrrrrrr
i hate when people just dont know anything and want the easy way....i told ya how to find out whatever u like on any unix box MAN command....if that isnt clear enough or well too complicated google it, there are plenty of websites for beginners on the matter....
its not entirly directed at you....but £%£$^"£ try and find out for urself these little things....u know gives ya some reward too by finding out things urself and get a few things self thought rather than just ask on a forum where you have to wait....
if you would have googled this information any questiens on that regard you would have known by now and even more than me by the time im actually typing this msg...
dont want to sound mean....but hey cmon....you have the bigest bloody library infront of your eyes when u stare at your monitor USE IT