Results 1 to 5 of 5
Hello,
I have just started my "adventure" with Linux and i have a problem. I've tried everything but i couldn't finish my examples.
Here they are:
1) Using ls command ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-25-2012 #1Just Joined!
- Join Date
- Oct 2012
- Posts
- 3
ls Command Problem
Hello,
I have just started my "adventure" with Linux and i have a problem. I've tried everything but i couldn't finish my examples.
Here they are:
1) Using ls command find all files in /etc which have got 4 or more letters ....
I've tried
ls -d /etc/????
But it only shows words with 4 letters (but no more) ...
2) Using ls command find files in /etc which penultimate letter is small
I have no idea how to do this. I've tried
ls -d /etc/?[a-z]? but it will only work for word with 3 letters ...
3) Using command Find files in /etc which 3 letter is Capital
I don't know how to do this for word which has f.e 4 or more letters ...
ls -d /etc/??[A-Z] /etc/???[A-Z] - but how to do this "general" - when we don't know how many letters has the word ... ANd other problem is when i type [A-Z] - Debian doesn't recognize Capital letter from this range ... only small ...
THanks in advance for help/advices
rajd3r
- 10-26-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,673
Hello and welcome!
Is this a homework question? If so, they are against Forum Rules. However, we can still give you helpful advice. Here's some now: Check out grep. Hint: the '.' character matches any character.
- 10-26-2012 #3Just Joined!
- Join Date
- Oct 2012
- Posts
- 3
It's not exactly homework - doesn't matter

I understand and yes, hints will be very helpful - i didn't expect "ready answer"
I'll try sth with grep.
Thanks for help.
rajd3r
- 10-26-2012 #4Just Joined!
- Join Date
- Oct 2012
- Posts
- 3
1) Using ls command find all files in /etc which have got 4 or more letters ....
I've tried
ls -d /etc/????
But it only shows words with 4 letters (but no more) ...
Ok i think it works when i type:
ls -d /etc/????*
atrey: The only problem is that i have to do this without grep
Only ls -d command /etc/.....
rajd3r
EDIT: OK i solved the problem. You can close.
Thanks for advices
rajd3rLast edited by rajd3r; 10-26-2012 at 12:52 PM.
- 10-26-2012 #5Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,673




