Which command alters the permission mode for files starting with the prefix emp and terminating with 1, 2, or 3 ?
Show answer Hide answer
Answer: A. chmod u+x emp[1-3]
Explanation
The chmod command modifies file permissions while u+x specifically adds execute rights for the file owner. The bracketed wildcard pattern emp[1-3] precisely targets files starting with emp and ending with digits one through three. Combining these arguments updates the specified subset of files without altering permissions for unrelated documents. Unix file permissions are divided into user, group, and other categories with read, write, and execute attributes. Bracket expressions in shell globbing allow administrators to match any single character enclosed within the square brackets. File permission management is a cornerstone of multiuser security models implemented across modern operating systems.
Using an asterisk in chmod 777 emp* would incorrectly match any file starting with emp regardless of the trailing characters. The pattern emp with question marks checks for different filename structures and does not properly target digits one through three. Applying write permissions with arbitrary question marks fails to selectively target the intended group of numbered script files.
- Subject
- Computer Science
- Category
- Software Engineering
- Topic
- —
- Difficulty
- medium
Related questions
Q1. Which command navigates into a directory whose name begins with the letter ‘p’ ?
Show answer Hide answer
Answer: C. cd p*
The asterisk acts as a wildcard matching any character sequence following the initial letter p. Combining cd with a wildcard pattern directs the shell to enter the first matching directory entry. Shell globbing expands p...
Q2. Name service resolution order is configured in which file?
Show answer Hide answer
Answer: C. /etc/nsswitch.conf
The file /etc/nsswitch.conf configures name service resolution order for system lookups. Operating systems check this file to determine whether to query local files, DNS, or LDAP. Service databases like hosts, passwords,...
Q3. Which command combines all files starting with the prefix ’emp’ and followed by non-numeric characters ?
Show answer Hide answer
Answer: A. cat emp[!0-9]
The pattern emp[!0-9] matches filenames beginning with emp followed by any single character that is not a digit. The exclamation mark inside brackets acts as a negation operator within shell globbing pattern matching syn...
Q4. Transmitting email messages between servers relies upon what TCP/IP protocol?
Show answer Hide answer
Answer: C. SMTP
SMTP establishes the standard communication rules required for routing email messages between independent servers. Mail transfer agents rely on this protocol to deliver outbound messages across internet boundaries reliab...
Q5. Which command removes all files in the working directory along with every file and subfolder contained within its subdirectories ?
Show answer Hide answer
Answer: B. rm -r *
The command rm -r * recursively removes all files and subdirectories inside the working directory. Adding the recursive flag allows the removal tool to traverse and delete nested folder structures. Executing this command...
Q6. Which utility is used to inspect the status and characteristics of a running process ?
Show answer Hide answer
Answer: C. ps
The ps utility generates a snapshot displaying active processes along with their current status and characteristics. Administrators run this command to inspect process identifiers, CPU utilization, and memory consumption...