LX3 Flashcards

1
Q

Which option will cause the echo command NOT to output a trailing newline?
-e
-p
-n
-s

A
  • -n

The option “-n” will cause the echo command to not output a trailing newline. This means that when using the echo command with the “-n” option, the text will be displayed without a new line character at the end, allowing the next output to be displayed on the same line.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Which of the following is a requirement of the GPL license but not the BSD license?

Users who modify and distribute the software under the GPL license, must make the modifications they made, available to the recipients under the same license.

The GPL license forbids the removal of the copyright and license notices from the source code files that are distributed.

The GPL license contains a disclaimer of warranty requiring users not to hold the software authors liable to any damage.

The GPL license requires that any legal disputes be settled with the modification of Free Software Foundation.

A
  • Users who modify and distribute the software under the GPL license, must make the modifications they made, available to the recipients under the same license.

The requirement of making modifications available to recipients under the same license is specific to the GPL license and not the BSD license. The BSD license allows users to modify and distribute the software under different licenses, whereas the GPL license ensures that any modifications made are shared with others under the same license. This requirement promotes the open-source nature of the GPL license and encourages collaboration and sharing within the software community.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What permissions are set on a file with the command chmod 654 file.txt?
Drw-r-xr–
D–wxr-x–
–wxr-x–x
-rwxrw–x
-rw-r-xr–

A
  • -rw-r-xr–

The first character indicates the file type (in this case, it’s a regular file).

The next three characters “rw-“ specify the permissions for the file owner (read and write, but not execute).

The next three characters “r-x” specify the permissions for the group (read and execute, but not write).

The last three characters “r–” specify the permissions for others (read only, no write or execute).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Which of the following Ubuntu releases is considered most stable and fit to use for business purposes?
LTS
Xubuntu
Ubuntu Vanilla
Kubuntu
Xubuntu Server

A
  • LTS

LTS releases of Ubuntu are specifically designed for stability and long-term use, making them ideal for business environments where reliability and support are crucial. These LTS releases receive long-term support and security updates, typically for five years on the desktop and server editions. Therefore, LTS releases are recommended for business use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which of the following will change the group that is associated with a file?
Chmod
Chmod -w
Chown
Ls -g

A
  • Chown

The command “chown” is used to change the owner of a file, and by extension, it also changes the group associated with that file. This command allows the user to transfer ownership from one user to another, and in doing so, the group association may also be modified. Therefore, “chown” is the correct answer for changing the group associated with a file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

After installing a new package, in which directory are you most likely find its configuration file?
/lib
/conf
/etc
/usr
/opt

A
  • /etc

After installing a new package, you are most likely to find its configuration file in the /etc directory. The /etc directory is commonly used to store system-wide configuration files in Unix-like operating systems. It is the standard location for various configuration files, including those related to installed packages. Therefore, it is the most probable directory to find the configuration file of a newly installed package.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which of the following commands can be used to determine the time of the last login of a given user?
Showlog
Recent
Last
History
Login

A
  • Last

The “last” command can be used to determine the time of the last login of a given user. This command displays a list of recent login sessions, including the username, terminal, date, and time of each login. By using the “last” command followed by the username, you can specifically view the login history for that particular user.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What two-character sequence is present at the beginning of an interpreted script? Please specify two characters only.

A
  • # !

The two character sequence present at the beginning of an interpreted script is “#!”. This sequence is known as a shebang or hashbang and is used to specify the interpreter for the script. It tells the operating system which interpreter should be used to execute the script.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which command is used to make a shell variable known to subsequently executed programs?
Export
Announce
Env
Transfer
Mv

A
  • Export

The command “export” is used to make a shell variable known to subsequently executed programs. When a variable is exported, it becomes part of the environment of any child processes that are created. This means that the variable can be accessed and used by these programs. The “announce”, “env”, “transfer”, and “mv” commands do not serve this purpose.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which criteria are useful when deciding which operating system to use? (Choose three correct answers).
License costs
Ideological preferences of the system administrator
Linux can do everything, there is no need for further evaluation
Availability of mandatory applications and tools
Skills of the administrators and staff

A
  • License costs
  • Availability of mandatory applications and tools
  • Skills of the administrators and staff

The criteria that are useful when deciding which operating system to use are license costs, availability of mandatory applications and tools, and skills of the administrators and staff. License costs are important because they can vary greatly between different operating systems and can impact the overall budget of an organization. The availability of mandatory applications and tools is also crucial as certain industries or specific tasks may require specific software that may only be compatible with certain operating systems. Lastly, the skills of the administrators and staff play a significant role as they need to be familiar and proficient with the chosen operating system in order to effectively manage and troubleshoot any issues that may arise.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Which of the following is true about open source software?
Open source software can not be copied for free
Open source software is available for commercial use
The freedom to redistribute copies must include binary or
executable forms of the software but not the source code.
Open source software is not for sale

A
  • Open source software is available for commercial use

Open source software is available for commercial use because it allows users to modify, distribute, and use the software for any purpose, including commercial purposes. This means that businesses can use open source software without any restrictions or licensing fees, which promotes innovation and collaboration in the software industry. Additionally, the freedom to redistribute copies of open source software includes both the binary or executable forms as well as the source code, allowing users to share and improve upon the software.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which of the following software packages is an email server?
Postfix
Thunderbird
Apache
GIMP
MySQL

A
  • Postfix

Postfix is the correct answer because it is an email server software package. It is widely used for routing and delivering emails on a server. Thunderbird is an email client, Apache is a web server, GIMP is an image editing software, and MySQL is a database management system. Therefore, only Postfix fits the criteria of being an email server.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Which command line can be used to search help files that mention the word “copy”?
Man -k copy
Whatis copy
Man copy
Copy help
Copy -help

A
  • Man -k copy

The correct answer is “man -k copy” because the “man -k” command is used to search for keywords in the manual pages. In this case, it will search for help files that mention the word “copy”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Identify the proper device for the third partition, on the second hard disk, on the first IDE controller on a PC system.
/dev/hdb3
/dev/hd1b3
/dev/hdc1d2p3
Dev/hdc1a3
Dev/hdc1b3

A
  • /dev/hdb3

The answer /dev/hdb3 is the correct device for the third partition on the second hard disk on the first IDE controller on a PC system. The naming convention for Linux devices is /dev/[device][partition], where [device] represents the device identifier and [partition] represents the partition number. In this case, “hdb” represents the second hard disk, and “3” represents the third partition on that disk.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which network interface always exists in a Linux system?
Lo
Sit0
Wlan0
Vlan0
Eth0

A
  • Lo

The network interface “lo” always exists in a Linux system. “lo” stands for loopback and it is a virtual network interface that allows network communication within the same machine. It is used for testing and troubleshooting network configurations, as well as for accessing local services without the need for an external network connection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How can the current directory and its subdirectories be searched for the file name MyFile.xml?
Find . -name MyFile.xml
Grep MyFile.xml | find
Grep -r MyFile.xml
Less MyFile.xml
Search MyFile.xml ./

A
  • Find . -name MyFile.xml

This command uses find, which is a powerful utility for searching files in a directory hierarchy. Here’s how it works:

. specifies the current directory as the starting point for the search.

-name MyFile.xml tells find to look for files that exactly match the name “MyFile.xml”. Therefore, the correct option from the provided choices, formatted to match typical usage, is:

find -name MyFile.xml

17
Q

The following file is found in which system file?root:x:0:0::/root:/bin/bash
/etc/user.cong
/etc/shadow
/etc/passwd
/usr/bin/shadow
/etc/password

A
  • /etc/passwd

The correct answer is /etc/passwd. This file is found in the system file directory and contains essential information about user accounts on the system, such as usernames, user IDs, group IDs, home directories, and default shells. It is a plain text file that can be accessed by privileged users and some system processes for authentication purposes.

18
Q

Which of the following commands are used to view real-time memory usage (Choose two correct answers).
Memory
Top
Ps
Free
Nice

A
  • Top
  • Free

The “top” command is used to view real-time information about system processes, including memory usage. It provides a detailed overview of memory usage by displaying the total memory, used memory, free memory, and memory usage by individual processes. On the other hand, the “free” command is used to display the amount of free and used memory in the system, including the total, used, and free memory, as well as the memory used for buffers and cache. Both commands are commonly used to monitor and analyze memory usage on a system.

19
Q

Why is the file data.txt empty after executing sort data.txt > data.txt

Because, if data.txt is empty now, it must have been empty before

Because sort cannot sort text files, only binary files

Because sort detects that both files are the same

Because the file gets truncated before the sort is executed

A
  • Because the file gets truncated before the sort is executed

When the command “sort data.txt > data.txt” is executed, it redirects the sorted output of the “sort” command to the same file “data.txt”. However, the “>” operator truncates the file before any data is written to it. Therefore, the file becomes empty before the “sort” command is executed, resulting in an empty “data.txt” file.

20
Q

What is the usual absolute path of the personal directory for the user foo?

A

home , foo , /home , foo , /home/foo

The usual absolute path of the personal directory for the user “foo” is “/home/foo” or “/home/foo/”. This is because in most Linux systems, the personal directories for users are located in the “/home” directory, and the directory for the user “foo” would be named “foo”. The trailing slash (“/”) at the end of the path is optional and does not affect the correctness of the path.