LPI 010-160 Linux Essentials Certificate Exam, version 1.6 Exam Dumps and Practice Test Questions Set 5 Q61 – 75

Visit here for our full LPI 010-160 exam dumps and practice test questions.

Question 61

Which command is used to display the current working directory in Linux?

A) cd

B) ls

C) pwd

D) dir

Answer: C

Explanation:

The pwd command, which stands for print working directory, displays the full absolute path of the current directory where the user is located in the filesystem hierarchy. This command is essential for navigation and orientation within the Linux filesystem, helping users understand their current location especially when working with relative paths or complex directory structures.

When executed without any options, pwd outputs the complete path from the root directory to the current location. For example, if a user is in the documents folder within their home directory, pwd might display /home/username/documents. This information is crucial when executing commands with relative paths, copying files, or understanding script execution contexts.

The pwd command supports options including -L which displays the logical current working directory following symbolic links as they appear in the path, and -P which displays the physical directory without following symbolic links showing the actual filesystem location. The logical path is typically the default behavior matching what most users expect to see.

The cd command changes directories rather than displaying the current location. The ls command lists directory contents. The dir command is not a standard Linux command though it exists in some systems as an alias. The pwd command specifically provides current directory information essential for filesystem navigation and command execution in shell environments.

Question 62

What is the purpose of the chmod command in Linux?

A) To change file ownership

B) To change file permissions

C) To change file modification time

D) To change file location

Answer: B

Explanation:

The chmod command changes file permissions in Linux, controlling who can read, write, or execute files and directories. Permission management is fundamental to Linux security, enabling administrators and users to control access to sensitive information, protect system files from unauthorized modification, and manage executable program permissions across single-user and multi-user environments.

Linux permissions operate on three categories of users: the file owner, the group associated with the file, and all other users. For each category, three permission types exist: read allowing file content viewing or directory listing, write enabling file modification or directory content changes, and execute permitting program execution or directory access. chmod modifies these nine permission bits plus special bits like setuid and setgid.

The command accepts two syntax formats: symbolic mode using letters like u for user, g for group, o for others, and a for all combined with operators plus, minus, or equals and permission letters r, w, x; and numeric mode using octal digits where 4 represents read, 2 represents write, and 1 represents execute with permissions specified as three-digit numbers like 755 or 644.

The chown command changes file ownership rather than permissions. The touch command modifies file timestamps. The mv command changes file location. The chmod command specifically controls the permission bits that determine file and directory access rights, implementing discretionary access control fundamental to Linux security architecture.

Question 63

Which file contains user account information in Linux?

A) /etc/shadow

B) /etc/group

C) /etc/passwd

D) /etc/users

Answer: C

Explanation:

The /etc/passwd file contains user account information in Linux, storing essential details about every user account on the system including username, user ID, group ID, home directory location, and default shell. This file is readable by all users because many system utilities need access to user information for displaying usernames, determining home directories, and other non-sensitive operations.

Each line in /etc/passwd represents one user account with seven colon-separated fields: username used for login, password field which historically stored encrypted passwords but now typically contains an x indicating passwords are in /etc/shadow, user ID number uniquely identifying the user, primary group ID number, GECOS field containing user description or full name, home directory path, and login shell path.

The file includes both regular user accounts and system accounts used by services and daemons. System accounts typically have user IDs below 1000 and often use /sbin/nologin or /bin/false as their shell to prevent interactive login. Regular user accounts have UIDs starting from 1000 or 1001 depending on the distribution and typically use /bin/bash or another interactive shell.

The /etc/shadow file stores encrypted passwords separately with restricted permissions. The /etc/group file contains group membership information. The /etc/users file does not exist as a standard Linux configuration file. The /etc/passwd file specifically provides the core user account information database that authentication systems and user management utilities reference throughout Linux systems.

Question 64

Which command is used to search for files and directories in Linux?

A) locate

B) find

C) search

D) grep

Answer: B

Explanation:

The find command searches for files and directories in Linux by traversing the filesystem hierarchy in real-time, examining each file and directory against specified criteria such as name patterns, file types, sizes, modification times, permissions, or ownership. This powerful utility provides comprehensive search capabilities essential for system administration, file management, and automation tasks.

The basic find syntax specifies a starting directory followed by search criteria and optional actions to perform on matching files. Common search criteria include -name for filename patterns with wildcards, -type for file types like f for regular files or d for directories, -size for file size conditions, -mtime for modification time, -user for ownership, and -perm for permission matching. Multiple criteria combine with logical operators.

The find command can execute actions on matching files using -exec to run commands, -delete to remove files, -print to display paths which is the default action, or -ls to show detailed file information. For example, find /home -name “*.txt” -mtime -7 searches the /home directory for text files modified in the last seven days, while find /tmp -type f -mtime +30 -delete removes files older than thirty days.

The locate command searches a pre-built database rather than real-time filesystem traversal. The search command is not a standard Linux utility. The grep command searches file contents rather than finding files by attributes. The find command specifically provides real-time filesystem searching with extensive criteria and action capabilities essential for Linux file management.

Question 65

What does the su command do in Linux?

A) Shows system uptime

B) Switches to another user account

C) Suspends the current session

D) Summarizes disk usage

Answer: B

Explanation:

The su command, which stands for substitute user or switch user, allows a user to switch to another user account within the same terminal session. This command is fundamental for system administration tasks where administrators need to execute commands as different users, test user environments, or perform operations requiring specific user privileges without logging out and back in.

When executed without arguments, su switches to the root account prompting for the root password. To switch to a specific user, the syntax is su username which starts a shell as that user while maintaining the current environment variables. Using su – username or su -l username starts a login shell that fully simulates a fresh login with that user’s environment including their home directory and environment variables.

The command maintains an audit trail showing who switched to which account, which is important for security and accountability in multi-administrator environments. Modern Linux distributions often prefer sudo for privilege escalation because it provides more granular control, better logging, and allows users to execute privileged commands with their own password rather than requiring the root password.

System uptime is displayed by the uptime command. Session suspension uses job control commands like Ctrl+Z. Disk usage summarization uses the du command. The su command specifically enables user account switching within terminal sessions, providing the ability to assume different user identities for testing, administration, or privilege escalation purposes.

Question 66

Which directory contains system configuration files in Linux?

A) /bin

B) /etc

C) /var

D) /usr

Answer: B

Explanation:

The /etc directory contains system-wide configuration files in Linux, serving as the central location for configuration data that controls how the operating system and installed applications behave. This directory is essential for system administration as it houses text-based configuration files that administrators modify to customize system behavior, configure services, manage network settings, and control security policies.

Important files in /etc include /etc/passwd and /etc/shadow for user account information, /etc/group for group definitions, /etc/fstab for filesystem mount configuration, /etc/hostname for system name, /etc/hosts for static hostname-to-IP mappings, /etc/resolv.conf for DNS resolver configuration, and /etc/network or /etc/sysconfig/network-scripts for network interface configuration depending on the distribution.

The directory also contains subdirectories for specific purposes including /etc/init.d or /etc/systemd for service initialization scripts, /etc/ssh for SSH server configuration, /etc/apache2 or /etc/httpd for web server configuration, and /etc/security for security policies. Configuration file format is typically plain text making them editable with standard text editors, though some applications use XML or other structured formats.

The /bin directory contains essential command binaries. The /var directory stores variable data like logs and spool files. The /usr directory contains user programs and data. The /etc directory specifically serves as the configuration file repository where system-wide settings are stored in a standardized, accessible format for administration and customization.

Question 67

Which command displays active network connections in Linux?

A) ifconfig

B) ping

C) netstat

D) route

Answer: C

Explanation:

The netstat command displays active network connections, routing tables, interface statistics, masquerade connections, and multicast memberships in Linux. This versatile network diagnostic tool provides essential information for troubleshooting network issues, monitoring network activity, identifying listening services, and understanding network traffic patterns on the system.

Common netstat options include -a to show all connections including listening sockets, -t for TCP connections only, -u for UDP connections, -n to display numeric addresses and ports rather than resolving hostnames and service names, -p to show the process ID and name of programs using each connection, and -l to display only listening sockets. Combining options like netstat -tuln shows all listening TCP and UDP ports in numeric format.

The command output displays local and remote addresses with port numbers, connection states for TCP such as ESTABLISHED, LISTEN, TIME_WAIT, or CLOSE_WAIT, and associated process information when run with appropriate privileges. This information helps administrators identify which services are running, what connections are active, whether expected services are listening, and if unauthorized services have been started.

The ifconfig command configures and displays network interface information. The ping command tests network connectivity to specific hosts. The route command displays and modifies the routing table. The netstat command specifically provides comprehensive network connection and statistics information essential for network troubleshooting and security monitoring in Linux environments.

Question 68

What is the purpose of the tar command in Linux?

A) To compress files

B) To create and extract archive files

C) To transfer files between systems

D) To delete old files

Answer: B

Explanation:

The tar command creates and extracts archive files in Linux, combining multiple files and directories into a single archive file for storage, backup, or distribution purposes. The name tar stands for tape archive, reflecting its original purpose of writing backups to tape devices, though it is now commonly used for creating archive files on disk that can optionally be compressed.

Creating archives uses tar with the -c option for create, -f to specify the archive filename, and commonly -v for verbose output showing files being archived. For example, tar -cvf archive.tar /path/to/directory creates an archive. Adding compression uses -z for gzip compression creating .tar.gz files, -j for bzip2 creating .tar.bz2 files, or -J for xz compression creating .tar.xz files.

Extracting archives uses the -x option for extract, with tar -xvf archive.tar extracting to the current directory, or tar -xvf archive.tar -C /destination/path extracting to a specific location. The -t option lists archive contents without extracting, useful for examining archives before extraction. The command preserves file permissions, ownership, and directory structure during archiving and extraction.

While tar archives are often compressed, the tar command itself only archives files with compression handled by additional options. File transfer between systems uses scp, rsync, or ftp. Deleting old files uses rm or find with -delete. The tar command specifically provides archiving functionality that combines multiple files while optionally compressing them for efficient storage and distribution.

Question 69

Which environment variable specifies the user’s home directory in Linux?

A) $PATH

B) $HOME

C) $USER

D) $SHELL

Answer: B

Explanation:

The HOME environment variable specifies the user’s home directory path in Linux, pointing to the personal directory where users store their files, configuration settings, and personal data. This variable is fundamental to the Linux user environment, used by countless programs and scripts to locate user-specific data, save preferences, and provide default file operation locations.

The HOME variable is automatically set during login based on the user’s entry in /etc/passwd which specifies the home directory path as the sixth field. For regular users, this is typically /home/username, while the root user’s home directory is usually /root. Programs reference this variable to find user configuration files, save application data, and determine where to execute commands when paths are not specified.

Many commands and programs use HOME including cd without arguments which changes to the home directory, the tilde character ~ which expands to HOME in shell commands, configuration files located in HOME like .bashrc or .profile, and applications that store user preferences in HOME/.config or HOME/.local. Environment configuration ensures consistent behavior regardless of how a user logs in.

The PATH variable specifies directories searched for executable commands. The USER variable contains the username. The SHELL variable specifies the user’s default shell. The HOME variable specifically provides the home directory path that anchors user-specific file storage and configuration in Linux multi-user environments.

Question 70

Which command shows the last lines of a file in Linux?

A) head

B) tail

C) cat

D) more

Answer: B

Explanation:

The tail command displays the last lines of a file in Linux, defaulting to showing the final 10 lines unless specified otherwise. This command is particularly useful for viewing recent log file entries, monitoring file updates in real-time, checking the end of large files without loading the entire content, and extracting the most recent data from continuously growing files.

Common tail options include -n number or -number to specify how many lines to display, such as tail -n 20 file.txt or tail -20 file.txt showing the last 20 lines. The -f option follows the file, continuously displaying new lines as they are appended which is invaluable for monitoring active log files with commands like tail -f /var/log/syslog showing new log entries in real-time.

The command can process multiple files simultaneously, displaying each file’s last lines with a header identifying the filename. Combining options like tail -f -n 100 logfile starts following after displaying the last 100 lines. The related tailf command is optimized for following files that are not actively being written to, reducing system resource usage.

The head command displays the first lines of files rather than last lines. The cat command displays entire file contents. The more command provides paginated file viewing. The tail command specifically shows file endings and provides real-time monitoring capabilities essential for log file analysis and system monitoring in Linux administration.

Question 71

What does the grep command do in Linux?

A) Creates new files

B) Searches for text patterns in files

C) Compresses files

D) Changes file ownership

Answer: B

Explanation:

The grep command searches for text patterns in files using regular expressions or simple text strings, displaying lines that match the specified pattern. This powerful text search utility is fundamental to Linux command-line work, enabling users to find specific information in log files, filter command output, locate configuration settings, and extract relevant data from large text files.

Basic grep syntax is grep pattern filename which searches the specified file for lines containing the pattern. Common options include -i for case-insensitive search, -v to invert the match showing lines that do not contain the pattern, -r for recursive directory search, -n to display line numbers, -c to count matching lines, and -l to list only filenames containing matches rather than the matching lines themselves.

Advanced grep usage employs regular expressions for complex pattern matching, such as grep “^error” file.log finding lines starting with error, or grep “failed|error” searching for either failed or error. The command integrates seamlessly with pipes, enabling constructions like ps aux | grep apache to filter process listings, or cat logfile | grep -i warning | grep -v ignore to find warnings while excluding certain patterns.

The touch command creates files. The gzip command compresses files. The chown command changes ownership. The grep command specifically provides text pattern searching capabilities that make it one of the most frequently used Linux utilities for text processing, log analysis, and data extraction from files and command output.

Question 72

Which command is used to view and manage running processes in Linux?

A) ls

B) ps

C) df

D) du

Answer: B

Explanation:

The ps command views and manages information about running processes in Linux, displaying details such as process IDs, CPU and memory usage, execution time, parent-child relationships, and associated terminal sessions. This essential system administration tool enables monitoring of system activity, troubleshooting performance issues, identifying resource-intensive processes, and managing process execution.

Common ps usage includes ps aux which shows all processes for all users with detailed information including user ownership, CPU and memory percentages, process state, start time, and command arguments. The ps -ef format provides similar comprehensive output in a different format. Options can be combined variously such as ps -u username showing processes for a specific user, or ps -p PID displaying information for a specific process ID.

The command integrates with other utilities for enhanced functionality such as ps aux | grep process_name to find specific processes, ps aux –sort=-%mem to sort by memory usage, or combining with commands like kill to terminate processes. Modern alternatives include top and htop for interactive real-time process monitoring, though ps remains valuable for scripting and quick process information queries.

The ls command lists files and directories. The df command reports filesystem disk space usage. The du command estimates file and directory space consumption. The ps command specifically provides process information and status reporting essential for system monitoring, resource management, and troubleshooting in Linux environments.

Question 73

What is the purpose of the ln command in Linux?

A) To list network interfaces

B) To create links between files

C) To login to remote systems

D) To locate files

Answer: B

Explanation:

The ln command creates links between files in Linux, establishing relationships where multiple directory entries point to the same file data or where symbolic references point to file paths. Links provide flexible file organization, enable multiple access paths to the same content, conserve disk space for duplicate data, and maintain file accessibility when reorganizing directory structures.

Two link types exist: hard links created with ln source target that create additional directory entries pointing to the same inode and physical data on disk, and symbolic links or symlinks created with ln -s source target that create special files containing path references to target files. Hard links require both entries on the same filesystem and cannot link directories, while symlinks work across filesystems and can link directories.

Hard links maintain data accessibility even if the original filename is deleted because the data persists as long as any hard link exists. Symbolic links become broken if the target is deleted or moved, though they provide flexibility for cross-filesystem references and directory linking. Common symlink uses include creating shortcuts, maintaining compatibility when moving files, and managing software versions through links like /usr/bin/python pointing to specific python versions.

The ip or ifconfig commands list network interfaces. The ssh command logs into remote systems. The find or locate commands locate files. The ln command specifically creates filesystem links enabling flexible file access patterns and efficient storage management through shared data references in Linux filesystems.

Question 74

Which file system type is commonly used as the default in modern Linux distributions?

A) FAT32

B) NTFS

C) ext4

D) HFS+

Answer: C

Explanation:

The ext4 filesystem, which stands for fourth extended filesystem, is commonly used as the default filesystem in modern Linux distributions, providing reliable, high-performance storage with advanced features including large file and volume support, extent-based allocation, delayed allocation, journal checksumming, and backward compatibility with ext3 and ext2. This filesystem evolved from earlier extended filesystems incorporating lessons learned and modern storage requirements.

ext4 supports volumes up to 1 exabyte and individual files up to 16 terabytes, accommodating modern storage capacities far beyond what earlier filesystems could handle. Extents replace the traditional block mapping approach, improving performance for large files by describing contiguous storage ranges efficiently. Delayed allocation optimizes write performance by buffering data and allocating disk space just before writing, enabling better placement decisions.

The filesystem includes journaling for crash recovery, checksumming journal entries to detect corruption, online defragmentation capabilities, and fast filesystem checks through uninit_bg feature that marks block groups as uninitialized. Backward compatibility allows ext4 filesystems to be mounted as ext3 or ext2, and ext3 filesystems can be upgraded to ext4, though some features become unavailable.

FAT32 is a legacy filesystem used primarily for compatibility with other operating systems. NTFS is the Windows filesystem. HFS+ is the legacy macOS filesystem. The ext4 filesystem specifically serves as the default Linux filesystem, providing the stability, performance, and features required for modern Linux system and data storage needs.

Question 75

Which command shows the amount of free and used disk space on mounted filesystems?

A) free

B) du

C) df

D) fdisk

Answer: C

Explanation:

The df command, which stands for disk free, shows the amount of free and used disk space on all mounted filesystems, displaying information about total size, used space, available space, usage percentage, and mount points for each filesystem. This essential system administration tool enables monitoring storage capacity, identifying full filesystems, planning capacity expansion, and troubleshooting disk space issues.

Common df options include -h for human-readable output using units like KB, MB, and GB rather than raw block counts, -T to display filesystem types, -i to show inode usage instead of block usage which is important because filesystems can run out of inodes before disk space, and -x to exclude specific filesystem types like tmpfs or devtmpfs that represent virtual filesystems.

The command output displays each mounted filesystem with columns showing the filesystem name or device, total size, used space, available space, usage percentage, and mount point. For example, df -h might show /dev/sda1 with 100G total, 60G used, 40G available, 60% usage, mounted on /. This information helps administrators identify nearly full filesystems before they cause application failures or system issues.

The free command displays memory usage rather than disk space. The du command estimates file and directory space usage. The fdisk command manipulates disk partition tables. The df command specifically reports filesystem disk space utilization providing the high-level capacity information essential for storage management and capacity planning in Linux systems.