Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Basic file operations

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.

How would you copy a file named file5.txt from the Documents directory to the Backup directory?

a)

cp ~/Documents/file1.txt ~/Backup/

b)

ls- list file in directly

c)

cp ~/Documents/file5.txt ~/Backup/

d)

create links to a file

2.

What command would you use to list all files in a directory along with their inode numbers?

a)

ls-a

b)

ls -i

c)

ls -h

d)

ls -f

3.

How would you delete a file named temp.txt in the current directory?

a)

de temp.txt

b)

cp temp.txt

c)

rmi temp.txt

d)

rm temp.txt

4.

How would you rename a file old_name.txt to new_name.txt in the current directory?

a)

mv old_name.txt old_name.txt

b)

mv new_name.txt new_name.txt

c)

mv old_name.txt new_name.txt

d)

mv 1_name.txt old_name.txt

5.

How can you list files in a directory and include indicators for file types

a)

ls -F

b)

cp -F

c)

ls -I

d)

mv -F

6.

What command would you use to list files in a directory with detailed information, including file permissions, and display the sizes in a human-readable format (e.g., 1K, 2M)?

a)

ls -mv

b)

cp -lh

c)

ls -lh

d)

ls -25

7.

What can you use to recursively copy direction?

a)

-a or -R option

b)

only -a option

c)

only -R option

d)

All these answers

8.

What is meaning of -i in cp option?

a)

Ask before overwriting destination files

b)

force the copy

c)

copy file

d)

Copy a directory hierarchy recursively

9.

What is meaning of -f in cp option?

a)

read, write, and execute permissions on a file name

b)

Force the copy. If a destination file exists, overwrite it unconditionally.

c)

Force the copy.

d)

overwriting destination file

10.

Why use rm command?

a)

delete files

b)

copy files

c)

rename files

d)

create a link to another file