WorksheetsBasic file operations
Total questions: 10
Worksheet time: 5mins
How would you copy a file named file5.txt from the Documents directory to the Backup directory?
cp ~/Documents/file1.txt ~/Backup/
ls- list file in directly
cp ~/Documents/file5.txt ~/Backup/
create links to a file
What command would you use to list all files in a directory along with their inode numbers?
ls-a
ls -i
ls -h
ls -f
How would you delete a file named temp.txt in the current directory?
de temp.txt
cp temp.txt
rmi temp.txt
rm temp.txt
How would you rename a file old_name.txt to new_name.txt in the current directory?
mv old_name.txt old_name.txt
mv new_name.txt new_name.txt
mv old_name.txt new_name.txt
mv 1_name.txt old_name.txt
How can you list files in a directory and include indicators for file types
ls -F
cp -F
ls -I
mv -F
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)?
ls -mv
cp -lh
ls -lh
ls -25
What can you use to recursively copy direction?
-a or -R option
only -a option
only -R option
All these answers
What is meaning of -i in cp option?
Ask before overwriting destination files
force the copy
copy file
Copy a directory hierarchy recursively
What is meaning of -f in cp option?
read, write, and execute permissions on a file name
Force the copy. If a destination file exists, overwrite it unconditionally.
Force the copy.
overwriting destination file
Why use rm command?
delete files
copy files
rename files
create a link to another file
