Computer Science - Linux - Discussion

Discussion :: Linux - Section 1 (Q.No.22)

22. 

What command is not used to list the files chap01, chap02 and chap04?

[A]. ls chap*
[B]. ls chap[124]
[C]. ls - x chap0[124]
[D]. ls chap0[124]
[E]. None of the above

Answer: Option B

Explanation:

No answer description available for this question.

Dharam said: (Dec 31, 2011)  
We used ls chap* command.

Lalith Kumar M said: (May 22, 2012)  
ls chap0[124] will also work.

Surmeet said: (Oct 4, 2014)  
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. :).

Viswanatha said: (Feb 24, 2015)  
This command also work.

#ls chap*.

chap01 chap02 chap04.

Bhavika said: (Mar 13, 2015)  
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

Sam said: (Oct 13, 2015)  
Its a wildcard.

Tejas said: (Nov 4, 2015)  
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.

Buganda said: (Oct 11, 2017)  
According to me,

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

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.