MODULE 8- Managing files and directories Flashcards
(48 cards)
Which character standard does Linux use that is based on ASCII?
Linux uses the UTF-8 character standard, which is based on ASCII.
What man command can you use to learn more about ASCII in Linux?
man -s 7 ascii
What are glob characters in Linux commonly referred to as?
They are commonly referred to as wild cards.
Which glob character represents zero or more of any character in a filename?
The asterisk * character.
What pattern would match any file in /etc that starts with t?
/etc/t*
What pattern matches any file in /etc that ends with .d?
/etc/*.d
How are the * and ? characters different in globbing?
- matches zero or more characters; ? matches exactly one character.
What does the pattern /etc/r*.conf match?
Files in /etc that begin with r and end with .conf.
Which glob character matches exactly one character in a filename?
The question mark ?.
What does the pattern /etc/t??????? match?
Files in /etc that start with t followed by exactly seven characters.
What does the glob pattern /etc/[gu]* match?
Any file in /etc that starts with g or u, followed by zero or more characters
What pattern matches any filename in /etc that begins with any letter from a to d?
/etc/[a-d]*
Which globbing symbol allows you to match one character from a specific set of characters?
The bracket characters [].
According to the ASCII table, what must be true about character ranges in brackets?
The range must be in ascending ASCII order (e.g., a-z, not z-a).
What does the pattern /etc/[!DP]* match?
Files in /etc that do not start with D or P.
Which glob character is used with brackets to exclude certain characters from matching?
The exclamation point ! inside []
What does the pattern /etc/[!a-t]* match?
Files in /etc that do not begin with any lowercase letter from a to t
What does the -i option do when used with the cp command?
It prompts the user before overwriting any existing files.
Which command moves a file named hosts to the Videos directory?
mv hosts Videos
What does the -v option do when used with mv?
It shows the result of the move or rename operation (verbose output).
Which option combination prevents overwriting and avoids all interactive prompts while copying hidden files from /etc/skel/?
cp -n /etc/skel/.* ~
Which cp option automatically refuses to overwrite files without prompting?
The -n option (no clobber).
Which option allows the cp command to copy directories recursively?
The -r option
Which command removes directories and their contents?
rm -r