
Linux Midterm 01 Prep - Quiz 03 (Recovery)
Authored by DK Nitro5
Information Technology (IT)
Professional Development
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
72 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What command would you use to create an alias named "list" to execute ls -ail?
alias list='ls -ail'
alias list="ls -ail"
alias list="ls -la"
alias list='ls -l'
Answer explanation
Option B (alias list="ls -ail") is technically correct and works the same as Option A (alias list='ls -ail'). Both single quotes (') and double quotes (") can be used to create an alias in most shells, like Bash.
Here's the difference:
Single quotes (') keep everything inside them exactly as it is, without changing anything.
Double quotes (") allow things like variables or special characters to change if needed.
In this case, since no variables or special characters are involved, both A and B will work just fine.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which command would append the contents of the /etc directory to an existing file dump.txt?
ls /etc > ~/Assignment5/dump.txt
ls /etc >> ~/Assignment5/dump.txt
cat /etc > ~/Assignment5/dump.txt
find /etc >> ~/Assignment5/dump.txt
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which command would display the first 5 pathnames from the /etc directory?
find /etc | tail -5
find /etc | wc -l
find /etc | head -5
find /etc | sort | head -5
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
To count the number of files in a directory matching the pattern Week??, which command would you use?
find . -type d -name "Week*"
find . -type f -name "Week??" | wc -l
find . -type f -name "Week?"
ls Week?? | wc -l
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you redirect both standard output and error output to the same file?
command > file.txt
command 2> file.txt
command > file.txt 2>&1
command 2>1 > file.txt
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
if my current working directory is /home, and my HOME directory is /home/foo, which command copies file /bin/ls into my HOME directory under the name xx?
cp ../../bin/./ls /foo/xx
cp ./../bin/ls ../foo/xx
cp ./foo/../../bin/ls ./foo/./xx
cp ././foo/../bin/ls ../home/foo/xx
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
If I am in directory /home/user and tim is an empty sub-directory, what is true after this command line:
touch tim/./user user ; rm ./tim/user ../user/user
the command fails because the path ./tim/user does not exist
the directory user now contains a file named user
the directory tim is still empty
the command fails because the path ../user/user does not exist
the directory tim now contains a file named user
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?