zooby
July 15, 2010, 7:01am
1
Hi,
How do we list the files without .org files. For an example under test folder we have 100000 files out which we need to list the files like testfile.001,testfile.002,testfile.003 (i.e excluding org files)
testfile.001
testfile.001.org
testfile.002
testfile.002.org
....
ksh
ls -l !(*.org)
bash
shopt -s extglob
ls -l !(*.org)
zsh
ls -l ^*.org
[house@leonov] ls -1 . | grep -E '^test.[0-9]{3}$'
test.001
test.002
zooby
July 15, 2010, 7:26am
4
Thanks for your reply. We are using ksh and i tried as you suggested but am getting an error . Please advise
-bash: !: event not found
It appears that you're using bash, not ksh.
As I said, extended glob should be enabled:
shopt -s extglob
zooby
July 15, 2010, 7:59am
6
Thats worked . Thanks Mr dr.house and thanks all.
methyl
July 15, 2010, 8:01am
7
find /test_folder/ -type f ! -name \*\.org -print