rm touch f123 f35 f910txt How many files excluding director

rm *

touch f{1,2,3} f{3..5} f{9,10}.txt

How many files, excluding directories, exist in the working directory? Why?

Now come up with a command that only prints the number of files (so no directories)

Solution

1) How many files, excluding directories, exist in the working directory.

Answer:

f1 f10.txt f2 f3 f4 f5 f9.txt

Command: touch f{1,2,3} f{3..5} f{9,10}.tx

in this f{1,2,3} will create f1, f2, f3,

f{3..5} will create f4

f{9,10} will create f1.txt and f10.txt

2) command that only prints the number of files:

you can use below command.

file *

rm * touch f{1,2,3} f{3..5} f{9,10}.txt How many files, excluding directories, exist in the working directory? Why? Now come up with a command that only prints

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site