Lesson 15: Managing Linux and macOS Flashcards

1
Q

Which Linux command will display detailed information about all files and directories in the current directory, including system files?

A

‘ls -la’

Explanation: when we run ‘ls -la’, it’s essentially a combination of ‘ls -l’ (which gives a detailed listing) and ‘ls -a’ (which includes hidden files); this can be helpful for getting a comprehensive view of the contents of a directory.

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

A command has generated a large amount of data on the screen. What could you add to the command to make the output more readable?

A

‘more’ or ‘less’

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

What command would allow you to delete the contents of the folder ‘/home/jaime/junk’ and all its subdirectories?

A

‘rm -r /home/jaime/junk’

Explanation: the ‘rm’ command lets you delete a file or directory passing its name: ‘rm filename’ or ‘rm -d directory’; you can include a directory path too. If there are files in the directory, use the ‘-r’ option (‘rm -r directory’) to delete files and folders recursively.

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

What command could you use to move a file (names.doc) from your current directory to the USB stick linked to the folder ‘/mnt/usb’?

A

‘mv names.doc /mnt/usb’

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

A file is secured with the numeric permissions ‘0774’. What rights does ‘another user’ account have over the file?

A

Read-only.

Explanation:
- Read = 4
- Write = 2
- Execute = 1

To calculate the octal value for a set of file permissions, you add the values of the permissions that are granted. For example: rwx (read, write, and execute permissions) has an octal value of 7 (4+2+1 = 7).

To use octal values to set file permissions, you use the ‘chmod’ command with a ‘three-digit octal’ value.
- The first digit represents ‘the permissions for the owner’.
- The second digit represents ‘the permissions for the group’.
- The third digit represents ‘the permissions for others’.

For example: to set read, write, and execute permissions for the owner, and read-only permissions for the group and others, you would use the following command: ‘chmod 750 filename’.

In this command:
- The first digit (7) represents ‘the permissions for the owner’ (read, write, and execute)
- The second digit (5) represents the ‘permissions for the group’ (read and execute)
- The third digit (0) represents the ‘permissions for others’ (no permission).

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

Where would you look for the option to view and configure wireless adapter status in macOS?

A

In the ‘Status’ menu on the ‘Menu’ bar, in the top-right of the screen, or in the ‘Network’ prefpane.

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

Which Linux command allows a user to run a specific command or program with superuser / root privileges?

A

‘sudo’

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

How do you activate ‘Spotlight Search’ using the keyboard?

A

‘Command’ + ‘spacebar’

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

Your company is replacing its Windows desktops with Mac workstations, and you need to assist users with the transition. What is the equivalent of ‘File Explorer’ in macOS?

A

The Finder

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

How would you update an app purchased from the Mac App Store?

A

Opening the ‘Mac App Store’ and selecting the ‘Updates’ button.

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

What is the name of ‘Apple’s backup software’ for macOS?

A

Time Machine

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

*A Linux server administrator wants to elevate their privileges. Which of the following commands makes elevating an account possible? (Select all that apply.)

A. ‘su’
B. ‘passwd’
C. ‘sudo’
D. ‘chown’

A

‘su’ and ‘sudo’

The su (switch user) command switches to the account specified by username: su username. It is possible to switch to the superuser account by omitting the username argument.

The sudo (superuser do) command allows any account listed in the /etc/sudoers file user to run specified commands with superuser privilege level.

The command passwd can be used to change the password. This is not an elevation of privileges.

The command chown allows the superuser to change the owner of a file or directory. Note that this right is reserved to superuser or sudoer. Elevation of privileges is required to invoke this.

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

A Linux administrator needs to run automation scripts and looks for a shell on their server. Which of the following should they NOT look for?

A. Bash
B. Zsh
C. Ksh
D. TTY

A

D. TTY

The terminal and shell are connected by a ‘teletype’ (TTY) device that handles text input and output in separate streams.

The shell provides a command environment by which a user can operate the OS and applications. Many shell programs are available to use with Linux, with bash being the most notable.

Zsh is another common shell program. These shells expose the same core command set but are distinguished by support for features such as command history, tab completion, command spelling correction, or syntax highlighting.

Ksh (Korn shell) is another common shell program.

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

A client systems administrator for Mac computers wants to ensure users’ data is backed up locally. What should the administrator enable?

A.Recovery
B.Disk Utility
C.Time Machine
D.App Store

A

C. Time Machine

The Time Machine prefpane enables data to be backed up to an external drive or partition formatted using either the Apple File System (APFS) or macOS’s older extended file system.

MacOS includes a set of utilities that can be used to restore a Mac from the Time Machine backup program, reinstall macOS from a system image, or reformat or repair the system disk.

The Disk Utility app can be used to verify or repair a disk or file system. It can also be used to erase a disk with security options in case of selling or passing on a Mac.

The App Store provides a central portal for Apple and developers to distribute free and paid-for software.

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

A Windows user decides to start testing out Macs. They are working on a paper for school and need to cut and paste quite a bit. On the PC keyboard, they use Ctrl+X and Ctrl+V. What key should they use on the Mac?

A. Option
B. Command
C. Apple
D. Magic Mouse

A

B. Command

Where PC and Linux keyboards use CTRL, ALT, ALTGR, and START modifier keys, Mac keyboards have an APPLE/POWER key and COMMAND, OPTION, and CONTROL keys. COMMAND is closest to the CTRL key in terms of functionality.

OPTION is usually mapped to ALT. Use the Keyboard pane in System Preferences to map keys if using a non-Apple keyboard to operate a Mac.

The Apple key is the power button. This will definitely not help the user to cut and paste and might even cause loss of data if not saved properly.

Macs do not support touch screen interfaces, but they do support gesture-enabled Magic Mouse and Magic Trackpad peripherals.

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

After downloading a new app from the internet, a user drags the file from the Downloads folder to the Applications folder on their Mac. What occured as a result of this activity?

A.The package contents were copied.
B.The app setup needs to perform additional actions.
C.The application was sideloaded.
D.The app was installed.

A

D. The app was installed

When the app has been installed, it is placed in a directory with a .app extension in the Applications folder.

DMG (disk image) format is used for simple installs where the package contents just need to be copied to the Applications folder.

PKG format is used where app setup needs to perform additional actions, such as running a service or writing files to multiple folders.

Devices that allow installation of apps from untrusted sources, such as by sideloading APK packages or via developer mode, could also have weakened permissions.

16
Q

A server administrator wants to keep up with security patches and configures their machines to pull updates. What should the administrator configure the clients to pull updates from?

A. Distribution
B. apt-get
C. Repositories
D. Yum

A

C. Repositories

Copies of distribution packages (including any updates) will be posted to a software repository. Often the vendor will maintain different repositories. It can then be used to install, uninstall, or update the software.

A distribution contains any precompiled software packages the vendor or sponsor considers appropriate. The distributions are pushed to the repositories.

apt-get is a command interface for APT. The update, upgrade, and install commands are used to update/patch and install software.

Yum is the command interface for YUM. The update, check-update, and install commands are used to update/patch, and install software.

17
Q

An intern is going to work for the Linux administration team. They need to use a file editor but are not familiar with Linux. Which of the following is the easiest to use coming from a non-Linux background?

A. vi
B. nano
C. cat
D. cp

A

C. nano

The Nano text editor is a basic example often preferred by those coming from a Windows environment. To open or create a file, use nano filepath or nano -l filepath to show line numbers.

Many administrators prefer to use vi or vim. These tools have two modes. Command mode is used for file operations, such as writing changes and closing the editor.

While cat is not a file editor, it can be used to view the contents of a file or even write to a file.

Cp is used to create a copy of files either in the same or different directory with the same or different name.

18
Q

A coffee company sets up computer kiosks for customers. The company wants a hip trendy setting so they decide to use Mac computers. However, the person setting it up has no idea how to use Macs. What can they use to help them during setup?

A.Spotlight Search
B.Dock
C.Terminal
D.Mission control

A

A. Spotlight Search

Spotlight Search can be used to find almost anything on macOS. To start a new search, click the magnifying glass in the menu bar or press COMMAND+SPACE to bring up the search box.

The Dock at the bottom of the screen gives one-click access to users’ favorite apps and files, similar to the taskbar in Windows. Apps that are open in the dock display a dot below the icon.

The Terminal can be used to access the command-line environment, which uses either the Z shell (zsh) or Bash.

The Mission Control feature is used for window management and enables the user to set up multiple desktops with different sets of apps, backgrounds, and so on.

19
Q

A penetration tester is asked to perform an assessment on the new Mac laptops a company brought into the environment. After loading a shell on a user’s computer, the tester needs to find the passwords. Where should the tester look?

A.FileVault
B.Security & Privacy
C.Apple ID
D.Keychain

A

D. Keychain

The keychain helps you to manage passwords for these accounts, other websites, and Wi-Fi networks. This feature is also available as iCloud Keychain.

FileVault is a disk encryption product. Encryption protects the data stored on a disk against the possibility that a threat actor could remove it from the computer and use a foreign OS to read the files.

As with Windows, macOS has options to configure what analytics/telemetry data and personalized information can be collected, plus permissions for apps to use features. This is found in the Security & Privacy prefpane.

Each local account can be associated with an Apple ID. This Apple ID is used for purchases from the App Store, accessing iCloud and other functions.

20
Q

A security administrator wants to harden Linux machines and remove any unnecessary running processes. What command can the administrator use to inventory running processes?

A. ‘ip’
B. ‘dig’
C. ‘chmod’
D. ‘ps’

A

D. ‘ps’

The ps command invokes the process table, which is a record that summarizes the current running processes on a system.

As part of the iproute2 package, the ip command has options for managing routes as well as the local interface configuration.

Dig is a powerful tool for gathering information and testing name resolution. It is installed on most Linux distributions. Output will include the IP address mapped to the domain name, the DNS server that answered the query, and how long it took to receive that answer.

The chmod command can be used to secure files and directories, using either symbolic or octal notation. Only the owner can change permissions.

21
Q

A penetration tester is asked to perform an assessment on the new Mac laptops a company brought into the environment. After loading a shell on a user’s computer, the tester needs to find the passwords. Where should the tester look?

A.FileVault
B.Security & Privacy
C.Apple ID
D.Keychain

A

D. Keychain

The keychain helps you to manage passwords for these accounts, other websites, and Wi-Fi networks. This feature is also available as iCloud Keychain.

Other options

A. FileVault is a disk encryption product. Encryption protects the data stored on a disk against the possibility that a threat actor could remove it from the computer and use a foreign OS to read the files.

B. As with Windows, macOS has options to configure what analytics/telemetry data and personalized information can be collected, plus permissions for apps to use features. This is found in the Security & Privacy prefpane.

C. Each local account can be associated with an Apple ID. This Apple ID is used for purchases from the App Store, accessing iCloud and other functions.

22
Q

A server administrator wants to keep up with security patches and configures their machines to pull updates. What should the administrator configure the clients to pull updates from?

A.Distribution
B.apt-get
C.Repositories
D.Yum

A

C. Repositories

Copies of distribution packages (including any updates) will be posted to a software repository. Often the vendor will maintain different repositories. It can then be used to install, uninstall, or update the software.

Other options

A. A distribution contains any precompiled software packages the vendor or sponsor considers appropriate. The distributions are pushed to the repositories.

B. apt-get is a command interface for APT. The update, upgrade, and install commands are used to update/patch and install software.

D. Yum is the command interface for YUM. The update, check-update, and install commands are used to update/patch, and install software.

23
Q

An intern is going to work for the Linux administration team. They need to use a file editor but are not familiar with Linux. Which of the following is the easiest to use coming from a non-Linux background?

A.vi
B.nano
C.cat
D.cp

A

B. nano

The Nano text editor is a basic example often preferred by those coming from a Windows environment. To open or create a file, use nano filepath or nano -l filepath to show line numbers.

Other options

A. Many administrators prefer to use vi or vim. These tools have two modes. Command mode is used for file operations, such as writing changes and closing the editor.

C. While cat is not a file editor, it can be used to view the contents of a file or even write to a file.

D. Cp is used to create a copy of files either in the same or different directory with the same or different name.

23
Q

After downloading a new app from the internet, a user drags the file from the Downloads folder to the Applications folder on their Mac. What occured as a result of this activity?

A.The package contents were copied.
B.The app setup needs to perform additional actions.
C.The application was sideloaded.
D.The app was installed.

A

D. The app was installed

When the app has been installed, it is placed in a directory with a .app extension in the Applications folder.

Other options

A. DMG (disk image) format is used for simple installs where the package contents just need to be copied to the Applications folder.

B. PKG format is used where app setup needs to perform additional actions, such as running a service or writing files to multiple folders.

C. Devices that allow installation of apps from untrusted sources, such as by sideloading APK packages or via developer mode, could also have weakened permissions.

24
Q

A Linux administrator needs to run automation scripts and looks for a shell on their server. Which of the following should they NOT look for?

A.Bash
B.Zsh
C.Ksh
D.TTY

A

D. TTY

The terminal and shell are connected by a teletype (TTY) device that handles text input and output in separate streams.

Other options

A. The shell provides a command environment by which a user can operate the OS and applications. Many shell programs are available to use with Linux, with bash being the most notable.

B. Zsh is another common shell program. These shells expose the same core command set but are distinguished by support for features such as command history, tab completion, command spelling correction, or syntax highlighting.

C. Ksh (Korn shell) is another common shell program.

25
Q

A security administrator wants to harden Linux machines and remove any unnecessary running processes. What command can the administrator use to inventory running processes?

A.ip
B.dig
C.chmod
D.ps

A

D. ps

The ps command invokes the process table, which is a record that summarizes the current running processes on a system.

Other options

A. As part of the iproute2 package, the ip command has options for managing routes as well as the local interface configuration.

B. Dig is a powerful tool for gathering information and testing name resolution. It is installed on most Linux distributions. Output will include the IP address mapped to the domain name, the DNS server that answered the query, and how long it took to receive that answer.

C. The chmod command can be used to secure files and directories, using either symbolic or octal notation. Only the owner can change permissions.

26
Q

A client systems administrator for Mac computers wants to ensure users’ data is backed up locally. What should the administrator enable?

A.Recovery
B.Disk Utility
C.Time Machine
D.App Store

A

C. Time Machine

The Time Machine prefpane enables data to be backed up to an external drive or partition formatted using either the Apple File System (APFS) or macOS’s older extended file system.

Other options

A. MacOS includes a set of utilities that can be used to restore a Mac from the Time Machine backup program, reinstall macOS from a system image, or reformat or repair the system disk.

B. The Disk Utility app can be used to verify or repair a disk or file system. It can also be used to erase a disk with security options in case of selling or passing on a Mac.

D. The App Store provides a central portal for Apple and developers to distribute free and paid-for software.

27
Q

A Windows user decides to start testing out Macs. They are working on a paper for school and need to cut and paste quite a bit. On the PC keyboard, they use Ctrl+X and Ctrl+V. What key should they use on the Mac?

A.Option
B.Command
C.Apple
D.Magic Mouse

A

B. Command

Where PC and Linux keyboards use CTRL, ALT, ALTGR, and START modifier keys, Mac keyboards have an APPLE/POWER key and COMMAND, OPTION, and CONTROL keys. COMMAND is closest to the CTRL key in terms of functionality.

Other options

A. OPTION is usually mapped to ALT. Use the Keyboard pane in System Preferences to map keys if using a non-Apple keyboard to operate a Mac.

C. The Apple key is the power button. This will definitely not help the user to cut and paste and might even cause loss of data if not saved properly.

D. Macs do not support touch screen interfaces, but they do support gesture-enabled Magic Mouse and Magic Trackpad peripherals.

28
Q

A Linux server administrator wants to elevate their privileges. Which of the following commands makes elevating an account possible? (Select all that apply.)

A.su
B.passwd
C.sudo
D.chown

A

A. su and C. sudo

A. The su (switch user) command switches to the account specified by username: su username. It is possible to switch to the superuser account by omitting the username argument.

C. The sudo (superuser do) command allows any account listed in the /etc/sudoers file user to run specified commands with superuser privilege level.

Other options

B. The command passwd can be used to change the password. This is not an elevation of privileges.

D. The command chown allows the superuser to change the owner of a file or directory. Note that this right is reserved to superuser or sudoer. Elevation of privileges is required to invoke this.

29
Q

A coffee company sets up computer kiosks for customers. The company wants a hip trendy setting so they decide to use Mac computers. However, the person setting it up is unfamiliar with macOS. What can they use to obtain advice for this task?

A.Spotlight Search
B.Dock
C.Terminal
D.Mission control

A

A. Spotlight Search

Spotlight Search can be used to find almost anything on macOS. To start a new search, click the magnifying glass in the menu bar or press COMMAND+SPACE to bring up the search box.

Other options

B. The Dock at the bottom of the screen gives one-click access to users’ favorite apps and files, similar to the taskbar in Windows. Apps that are open in the dock display a dot below the icon.

C. The Terminal can be used to access the command-line environment, which uses either the Z shell (zsh) or Bash.

D. The Mission Control feature is used for window management and enables the user to set up multiple desktops with different sets of apps, backgrounds, and so on.