Computer Science - Linux - Discussion

Discussion Forum : Linux - Section 1 (Q.No. 22)
22.
What command is not used to list the files chap01, chap02 and chap04?
ls chap*
ls chap[124]
ls - x chap0[124]
ls chap0[124]
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
8 comments Page 1 of 1.

Buganda said:   8 years ago
According to me,

Is chap0[124]: is the answer.
Is -x chap0[124]: row(lines) and not columns.

Tejas said:   10 years ago
ls chap* will give any file starting with chap and we want chap 01, 02 and 03.

ls chap[124]: Will give error.

ls chap0[124]: Will get output chap 01, 02, qnd 03.

ls -x chap0[124]: Will get output by line instead of by columns.

Sam said:   10 years ago
Its a wildcard.

Bhavika said:   1 decade ago
ls chap*
chap01 chap02 chap04

ls chap[124]
ls: chap[124]: No such file or directory

ls chap0[124]
chap01 chap02 chap04

ls -x chap0[124]
chap01 chap02 chap04

Viswanatha said:   1 decade ago
This command also work.

#ls chap*.

chap01 chap02 chap04.

Surmeet said:   1 decade ago
1> ls chap* - will list all the files starting with "chap" and we want only chap01, chap02 & chap04.

2> ls -x chap0[124] - "x" list entries by lines instead of by columns.

But yes we can get output with ls chap0[124] as well. :).

Lalith kumar m said:   1 decade ago
ls chap0[124] will also work.

Dharam said:   1 decade ago
We used ls chap* command.

Post your comments here:

Your comments will be displayed after verification.