Hello,
I am fairly new to Unix, I've been running Ubuntu 10.10 on my laptop for a couple days now. I have followed a tutorial on using the terminal, and I can get around but there are some things I haven't figured out how to do yet.
For example, I have a directory which contains all my movies, series etc. I want to search through it, and find all files that are either .mkv, .wmv or .avi files, but that don't end in -sample.*whichever*.
I have got this so far
ls -lhR | grep sample.* -vi | grep .mkv
It shows all .mkv files that don't end in sample or Sample.
What I can't figure out yet:
- how can I view .wmv or .avi files at the same time too?
- if I want to search for -sample.* instead of sample.*, how do i make sure it doesn't see -sample as an option for grep?
- I wanted to see the diff between using -v and -vi in the first grep command. I tried:
diff ls -lhR | grep sample.* -vi | grep .mkv ls -lhR | grep sample.* -v | grep .mkv
but that didn't work. Adding ( ), which was just a random guess btw, caused a syntax error. Is there any way to do this?
Thanks in advance!