Ads

Ads

Friday, December 25, 2009

Unix query---

1)To list all files in current directory whose second character is digit.
->$ls ?[0-9]*

2)To list all files in current directory whose 1st and last character is digit.
->$ls [0-9]*[0-9]

3)To list all files in current directory whose 1st character is special character.
->$ls [!0-9 a-z A-Z]*

4)To list all files in current directory in which 'a' or 'b' or 'k' letter exist anywhere.
->$ls *[abk]*

5)To count No. of files in current directory.
->$ls|wc -l
or
->$ls -1|wc -l

0 comments:

Trackers

Technology blogs