1.

Solve : need help lsiting files?

Answer»

i have a folder called 'lab2b' which contains a subfolder called 'lab2b_sub'

in the 'lab2b_sub' folder, there are the FOLLOWING FILES:

group.copy , lab2b_sub.copy , myProfile , passwd , passwd.copy

from the 'lab2b' folder, how would i list all files in 'lab2b_sub' EXCEPT for myProfile?

my guess is soething dealing with WILDCARDS and filter out the capital 'p' with square brackets and '!' but i cant figure it out.. im still new to unix XD

hope someone can help me out ^^Homework question?

What does ls lab2b_sub/[^myProfile]* do? (sh and Bash shells...)Quote

Homework question?

What does ls lab2b_sub/[^myProfile]* do? (sh and Bash shells...)

it lists group.copy, passwd, passwd.copy

doesnt not list myProfile or lab2b_sub.copy

hm..

also when i tried "ls lab2b_sub/[!m]*"

its lists the 4 files and excludes myProfile, howerver, the list is not one line like a normal list looks like. but it looks something like this:

group.copy passwd passwd.copy

lab2b_sub.copy

(my command line)

---
is that wrong? or is that correct.. my guess is that lab2b_sub is on a separate line because it is a directory and the other 3 are files?Yup. Is this an assignment? Are you learning about shell expansion? How about using grep/awk?there's another way, check if you have --hide OPTION of your ls ? something like this
Code: [Select]ls -l --hide=myProfile lab2/lab2_sub/*
That option is from the GNU Coreutils - which O/S, distro and shell are you using, ghostdog?Quote
That option is from the GNU Coreutils - which O/S, distro and shell are you using, ghostdog?

hi there
i am using Fedora core 5. i am just reading my ls man page and found this option...TESTED it out and seems to work...
As if by magic, that command line option has suddenly appeared in my version of ls...


Discussion

No Comment Found