Computer Science - Unix - Discussion
Discussion Forum : Unix - Section 1 (Q.No. 17)
17.
Which command is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric characters?
Discussion:
8 comments Page 1 of 1.
Prateek said:
9 years ago
I have 3 files.
1) Ab2.txt. The content of the file is 2343t.
2) Abc.txt. The content of the file is Hello.
3) Aba.txt. The content of the file is Kuch Bhi.
Now if I do cat ab[!0-9] then output should come according to your example but what I am getting is:
Cat: 'ab[!0-9]': No such file or directory.
1) Ab2.txt. The content of the file is 2343t.
2) Abc.txt. The content of the file is Hello.
3) Aba.txt. The content of the file is Kuch Bhi.
Now if I do cat ab[!0-9] then output should come according to your example but what I am getting is:
Cat: 'ab[!0-9]': No such file or directory.
Harsh said:
6 years ago
Cat emp[!0-9] in this case we have not 0 to 9 or a combination of no. are not allowed.
Cat emp[a-z] in this case only we can able to write the lower case and also 0-9 no. So this is wrong as well for all.
So, option A is correct according to me.
Cat emp[a-z] in this case only we can able to write the lower case and also 0-9 no. So this is wrong as well for all.
So, option A is correct according to me.
Chandra prakash said:
1 decade ago
1. Lenovo-G450:~$ cat > empa.
Rohan.
^C.
2. Lenovo-G450:~$ cat > empb.
Arya.
^C.
Result:
Lenovo-G450:~$ cat emp[!0-9].
Rohan.
Arya.
Rohan.
^C.
2. Lenovo-G450:~$ cat > empb.
Arya.
^C.
Result:
Lenovo-G450:~$ cat emp[!0-9].
Rohan.
Arya.
Alagan said:
8 years ago
cat emp[a-z] doesn't give files with symbols following emp. This doesn't mean non-numeric character.
Shilpi said:
1 decade ago
cat emp[!0-9] It will list all files starting from emp except numeric numbers which is 0-9.
Indresh said:
10 years ago
"cat emp[a-z] will also produce the same result as that of "cat emp[!0-9]".
Abanti said:
1 decade ago
! means not.
So, [!0-9] means non numeric.
So, [!0-9] means non numeric.
Lakshmi said:
1 decade ago
Can anyone explain this Answer?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers