Lesson 15: Managing Linux and macOS Flashcards
Which Linux command will display detailed information about all files and directories in the current directory, including system files?
‘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.
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?
‘more’ or ‘less’
What command would allow you to delete the contents of the folder ‘/home/jaime/junk’ and all its subdirectories?
‘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.
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’?
‘mv names.doc /mnt/usb’
A file is secured with the numeric permissions ‘0774’. What rights does ‘another user’ account have over the file?
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).
Where would you look for the option to view and configure wireless adapter status in macOS?
In the ‘Status’ menu on the ‘Menu’ bar, in the top-right of the screen, or in the ‘Network’ prefpane.
Which Linux command allows a user to run a specific command or program with superuser / root privileges?
‘sudo’
How do you activate ‘Spotlight Search’ using the keyboard?
‘Command’ + ‘spacebar’
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?
The Finder
How would you update an app purchased from the Mac App Store?
Opening the ‘Mac App Store’ and selecting the ‘Updates’ button.
What is the name of ‘Apple’s backup software’ for macOS?
Time Machine
*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’
‘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.
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
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.
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
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.
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
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.