Commands Flashcards
Which command enables one to show all available NFS mounts on ‘server1’?
showmount -e server1
The ‘-e’ option specifies that the command show the servers export list.
Which command can be used to show all available disk space on mounted devices?
df -hT
Just ‘df’ works but the ‘-h’ option formats the output in a human readable form and the ‘-T’ option shows which file system type is used on the different mounts.
Which command gives an overview of all mounted devices?
mount
Which command would list all files/directories (including hidden ones) along with their permissions inside a given directory?
ls -al
Which command would copy the contents of the ‘/etc’ directory (including other directories) to the ‘/tmp’ directory?
cp -R /etc /tmp
The -R option stands for recursive and allows subdirectories to be copied as well.
Which command would move the ‘myFile’ file to the
‘/tmp’ directory?
mv myFile /tmp
Which command would enable one to rename ‘myFile’ to ‘myNewFile’ ?
mv myFile myNewFile
Which command would create a symbolic link to the ‘/etc/passwd’ file in the current directory?
ln -s /etc/passwd .
Which command would create a new archive named ‘archive.tar’ in the directory ‘/root’, containing the contents of the entire ‘/etc’ directory?
tar -cvf /root/archive.tar /etc
The ‘-v’ option can be omitted as it simply lists the verbose output during execution.
The ‘-f’ option is used to specify the name of the archive file. It can often be omitted.
How would one add a single file named ‘singleFile’ to the already existing ‘archive.tar’ file?
tar -rvf archive.tar singleFile
The ‘-r’ option appends files to an existing archive.
Which command lists the contents of a tar archive ‘archive.tar’ without actually extracting it?
tar -tvf archive.tar
Which command would extract the contents of the ‘/root/archive.tar’ file and move the contents to the ‘/tmp’ directory?
tar -xvf /root/archive.tar -C /tmp
Extracting also works like this for compressed archives as tar will automatically recognize compressed content and then decompress it during extraction.
The ‘-C’ option stands for ‘change directory and tells tar to change the directory to where the command output will be placed.
Which command would create a compressed archive ‘archive.tar’ of everything within the ‘/etc’ directory and place that compressed archive in the ‘/home’ directory?
tar -czvf /home/archive.tar.gz /etc
tar -cjvf /home/archive.tar.bz2 /etc
tar -cJvf /home/archive.tar.xz /etc
All three of the above options work. The ‘-z’ option compresses with gzip. The ‘-j’ option compresses via bzip2 and the ‘-J’ option compresses via xz.
Which command would enable one to set the system time to 4:24 P.M. ?
date -s 16:24
Normally, ‘date’ retrieves the current time setting but the ‘-s’ option allows one to set the time.
Which command sets the hardware time from the system clock?
hwclock –systohc
hwclock -w
Which command shows epoch time as human-readable time?
date -d ‘@nnnnnnnn’
‘nnnnnnnn’ is the number of seconds since midnight on January 1st, 1970.
The ‘-d’ option specifies that the ‘date’ command will take a string specifying a time rather than just displaying the current time.
Which command enables you to use NTP time on your server?
timedatectl set-ntp 1
Which configuration file contains the list of NTP servers to be used?
/etc/chrony.conf
Which command displays information about the current time sources that ‘chronyd’ is currently accessing?
chronyc sources
Which commands would you use to display only line number 5 from the file ‘/etc/passwd’?
head -n 5 /etc/passwd | tail -n 1
Which command filters out just the first field from the file ‘/etc/passwd’?
cut -d : -f 1 /etc/passwd
The ‘-d’ option specifies the delimiter used in the file. The ‘-f’ option specifies which field to retrieve.
Which extended regular expression will match all files/subdirectories (including ‘/etc’) within the ‘/etc’ directory?
grep -rE ‘/etc(/.*)?’
The ‘.’ matches any single character.
The ‘*’ matches zero to an infinite number of the preceding character.
The ‘?’ matches zero or one of the preceding character.
The ‘-r’ option specifies to search files in the current directory and all subdirectories.
Which regular expression will match lines that do not begin with a ‘#’ in the file ‘/etc/services’?
grep -v ‘^#’ /etc/services
The ‘-v’ option shows lines that do not match the regular expression.
Which grep command enables you to see ‘text’ as well as ‘TEXT’ in a file named ‘/home/user/files’?
grep -i ‘text’ /home/user/files
The ‘-i’ option makes the regex case insensitive.
Which command enables you to replace all occurrences of the word user with the word users in ~/samplefile?
sed -i ‘s/user/users/g’ ~/samplefile
The ‘-i’ option for sed stands for ‘in-place’ which specifies that the command should edit the file rather than simply outputting the results.
If the ‘g’ at the end of the command is omitted, only the first occurrence of ‘user’ would be replaced.
Which command will install the appropriate tools for working with containers in RHEL 9?
sudo dnf install container-tools
Which command will list both currently running containers and ones that are now inactive?
podman ps -a
If you want to list the root containers, you must use ‘sudo podman ps’
Which command would run nginx in a container in the background?
podman run -d nginx
The ‘-d’ option stands for detached mode. This essentially runs it like a background daemon.
Which command will run an nginx container in interactive TTY mode, along with the ‘/bin/sh’ command?
podman run -it nginx /bin/sh
The ‘-i’ option stands for interactive while the ‘-t’ option gives access to the container TTY. Adding ‘/bin/sh’ to the end tells the container to run the ‘/bin/sh’ command rather than the default command. ‘/bin/sh’ may be the only shell available as containers are minimal environments.
What are the two common ways to exit interactive mode in a container?
- You could type ‘exit’ into the terminal. This could stop the whole container depending on the primary container command.
- You could use ‘Ctrl-P, Ctrl-Q’ to detach. This approach ensures that in all cases the container continues running in the background in detached mode.
How could you reconnect to a shell running within a container named ‘mybusybox’ ?
podman attach mybusybox
This would re-enter the shell running inside the ‘mybusybox’ container.
Which file specifies the container registries to be used?
‘/etc/containers/registries.conf’ or the user-specific file ‘~/.config/containers/registries.conf’
Which commands will easily show which container registries are currently being used?
podman info | grep -A 10 registries
‘podman info’ shows general Podman related system information. One could then pipe the output of that command into grep and search for the lines following the ‘registries’ string.
Which command will allow you to access the ‘registry.access.redhat.com’ registry?
podman login registry.access.redhat.com
Some container registries require that you authenticate before pulling container images.
Which command would search all container registries currently being used for ‘mariadb’ ?
podman search mariadb
Which command allows you to inspect container images before pulling them to your machine?
skopeo
‘podman inspect’ only works on images that are already pulled.
Which command lists the container images that are locally available? (already pulled)
podman images
Which command would allow you to see the command that a container image named ‘docker.io/library/nginx’ will run by default when it is started as a container?
podman inspect docker.io/library/nginx | grep -A 10 Cmd
The ‘Cmd’ section of the inspect output shows the list of default commands to be executed.
Which command prints the kernel release for the system?
uname -r
The ‘-r’ option specifies kernel release information.
Suppose you have a container running nginx named ‘mynginx’ and you want to get its kernel release. Which set of commands would accomplish that?
podman exec mynginx uname -r
‘podman exec’ executes a command in a running container.
How would you run an nginx container named ‘mynginx’ and make it accessible on host port 8080?
podman run –name mynginx -d -p 8080:80 nginx
The ‘-p’ option allows one to specify port mapping.
The host firewall must also be updated to allow traffic through TCP port 8080.
How could you find instructions on how to correctly run a specific container named ‘examplecontainer’ ?
podman inspect examplecontainer | grep -A 10 usage
The ‘usage’ section can sometimes include instructions for how to run the container. ‘podman logs examplecontainer’ could also include log information in case of a container failure.
How could you run the ‘mysql’ container with the ‘MYSQL_ROOT_PASSWORD’ environment variable set to ‘password’ ?
podman run -d -e MYSQL_ROOT_PASSWORD=password mysql
The ‘-e’ option allows one to specify an environment variable. Multiple ‘-e’ options can be used in sequence.
What two things must be prepared before a host directory can be accessed from within a container?
- The host directory must be writable for the user account that runs the container.
- The appropriate SELinux context label must be set to container_file_t.
Which commands would first create the directory ‘/opt/dbfiles’ and then allow others to write to that directory?
mkdir /opt/dbfiles; chmod o+w /opt/dbfiles
The ‘o+w’ part gives write permissions to everyone who isn’t the user owner or the group owner.
Which command would run a ‘mariadb’ container with the ‘MYSQL_ROOT_PASSWORD’ environment variable set to ‘password’ and also mount the ‘user/dbfiles’ directory from the host machine to the ‘/var/lib/mysql’ directory from inside the container?
podman run -d –name mymariadb -v user/dbfiles:/var/lib/mysql:Z -e MYSQL_ROOT_PASSWORD=password mariadb
The ‘-v’ option stands for volume and is used to bind a mount volume into the container. Adding the ‘Z’ option to the end of the volume mount string is necessary to ensure that the correct SELinux labels are set.
Keep in mind, the user who is running the container must be the owner of the host directory that is being mounted.
Which command makes Systemd services enabled for the user ‘student’ start running at system start rather than user log-in?
loginctl enable-linger student
Linger also ensures that the services will continue running after the user logs out.
Suppose you want to create a Systemd unit file that will start a container. Which directory must be created to store this Systemd unit file?
~/.config/systemd/user
Suppose you want to create a Systemd unit file that will start a container. Which command should be used to create a Systemd unit file based on a container named ‘mydb’ ?
podman generate systemd –name mydb –files –new
The ‘–files’ option specifies that a ‘.service’ file should be generated. The ‘–new’ option specifies that a new container should be created when the Systemd unit is started and that it should be deleted when stopped.
This ‘.service’ unit file should be generated inside the ~/.config/systemd/user directory. It should also be performed via an SSH session as the relevant user.
Once a Systemd unit file for a container named ‘mydb’ has been created, what two commands should be performed to ensure that it is detected and starts on reboot?
systemctl –user daemon-reload
systemctl –user enable container-mydb.service
The ‘daemon-reload’ option ensures that Systemd detects the changes. After a reboot, the ‘ps faux’ command should show that the ‘mydb’ container is running successfully.
Which command switches to the ‘tty4’ virtual terminal?
chvt 4
Which command would allow one to securely connect to remote host ‘server2’ as user ‘linda’ with graphical applications support?
ssh -Y linda@server2
The ‘-Y’ option enables support for graphical applications to be used via SSH.
Which file can be edited to create a systemwide configuration that permits ‘X forwarding’, which is starting graphical applications through an SSH session.
Edit the ‘/etc/ssh/ssh_config’ file to include the following line:
ForwardX11 yes
Which command can remotely copy all of the ‘/etc’ directory and its contents from server2 to the ‘/tmp’ directory on the local machine.
scp -r server2:/etc/ /tmp
‘scp’ copies files between hosts on a network via SSH. The ‘-r’ option recursively copies entire directories.
How could one open an SFTP prompt as user ‘student’ on ‘server2’ ? Then, how would one upload the ‘/etc/hosts’ file to ‘server2’ ?
sftp student@server2
put /etc/hosts
In an ‘sftp’ prompt, ‘put’ is used to upload files to the remote server. ‘get’ would be used to download a file to the current directory on the local machine. ‘lcd’ and ‘lpwd’ are used to run the ‘cd’ and ‘pwd’ commands back on the local machine.
What would the procedure be for configuring key-based login as the root user via SSH between server1 and server2?
Run ‘ssh-keygen’ as the root user and accept the defaults.
Run ‘ssh-copy-id server2’ as root to copy the public key to server2.
Now, ‘ssh server2’ should automatically connect to server2 as root without asking for the password. Make sure you are logged in as ‘root’ on ‘server1’ for this process.
Which command will display information about a user, including the UID and GIDs for all groups to which the user belongs?
id
Which command would give the user ‘lisa’ access to all sudo privileges?
usermod -aG wheel lisa
All members of the group ‘wheel’ have full sudo privileges. This command adds lisa to the group wheel. The ‘-a’ option stands for append and ‘-G’ specifies a group.
Which file contains configuration details for sudo privileges?
/etc/sudoers
Drop-in configuration files can also be added to the ‘/etc/sudoers.d’ directory.
Which command allows you to safely edit the sudo privileges?
visudo
Which line should be added to ‘/etc/sudoers’ to allow user ‘lisa’ to add new users and change their passwords but not for the root account?
lisa ALL=/usr/bin/useradd, /usr/bin/passwd, ! /usr/bin/passwd root
How could one extend the lifetime of the token that is given for sudo commands to 4 hours?
Add the following line to ‘/etc/sudoers’
‘Defaults timestamp_timeout=240’
What is the best way to use pipes with sudo privileges? How could we use this method for reading the contents of ‘/etc/passwd’ and searching for the root user?
sudo sh -c “cat /etc/passwd | grep root”
This allows everything in quotes to be executed as root.
Which file stores passwords for user accounts along with other password details?
/etc/shadow
The second field (delimited by colons) stores the hashed password. If the field begins with an ‘!’ then login for the account is currently disabled.
Which command would delete user ‘lisa’ along with her home directory?
userdel -r lisa
The ‘-r’ option removes the user’s home directory.
Which command would create a user ‘linda’ who is a member of the secondary groups ‘sales’ and ‘ops’ with ‘UID 1201’ and add a home directory to the user account as well.
useradd -m -u 1201 -G sales,ops linda
The ‘-m’ option creates the home directory. This overrides the ‘CREATE_HOME’ line in ‘/etc/login.defs’
The ‘-u’ option allows for a custom UID to be used. And the ‘-G’ option allows for additional groups to be specified.
Which configuration file is used to specify which files/directories are created by default in a user’s home directory?
/etc/skel
How could you change the default shell of user ‘caroline’ to prevent login?
usermod caroline -s /sbin/nologin
The ‘-s’ option specifies the login shell for the user account.
Using the ‘passwd’ command, how could one set the password for user ‘linda’ to a minimal usage period of 30 days and an expiry after 90 days, with a warning generated 3 days before expiry?
passwd -n 30 -w 3 -x 90 linda
The ‘-n’ option specifies the minimum usage period. The ‘-w’ option specifies the number of days before the expiration date that a warning be sent out while ‘-x’ specifies the actual expiration date.
Which command would set the user account for ‘bob’ to expire on December 31st, 2025?
chage -E 2025-12-31 bob
The ‘-E’ option specifies the account expiration date.
Which command allows one to interactively set the password properties for the user ‘anna’ ?
chage anna
This will interactively prompt you for each change to be made.
Which command lists current password management settings for user ‘anna’ ?
chage -l
What four files are used when constructing a user environment?
‘/etc/profile’ is used for default settings for all users when starting a login shell
‘/etc/bashrc’ is used to define defaults for all users when starting a subshell
’~/.profile’ or ‘~/.bash_profile’ specifies settings for one user applied when starting a login shell
’~/.bashrc’ specifies settings for one user applied when starting a subshell
These four files are read in the order they are listed upon login.
How would one set the default editor to ‘vim’ for the user ‘lisa’ ?
Add the following line to ‘/home/lisa/.bashrc’
‘export EDITOR=/usr/bin/vim’
Which file holds group information, such as the members for each group?
/etc/group
Which command will list the users that are members of group ‘sales’ ?
lid -g sales
The ‘-g’ option specifies that a group will be the argument. If used without the ‘-g’ option, ‘lid’ will list groups to which the invoking user belongs.
Which command creates new groups?
groupadd
Which command will remove the user ‘linda’ from the group ‘students’ ?
gpasswd -d linda students
The ‘gpasswd’ command allows one to administer the ‘/etc/group’ and ‘/etc/gshadow’ files. The ‘-d’ option stands for delete and allows one to specify a user to be removed from a group.
Which command will show all files on the machine that have the user ‘bob’ as their owner?
find / -user bob
This searches everything within the directory ‘/’ for files that are owned by user ‘bob’
The ‘find’ command can also use ‘-group’ to search for files owned by a specific group.
Which command will change ownership for the directory ‘/files’ and everything within it to the user ‘linda’ ?
chown -R linda /files
The ‘-R’ option tells the command to recursively set the permissions for everything within the directory as well as the directory itself.
Which command will change the group owner of the directory named ‘/photos’ and its contents to ‘artists’ ?
chown -R :artists /photos
chgrp -R artists /photos
The syntax for specifying users/groups with chown is:
‘chown user:group file’
Which command will list the groups a user belongs to?
groups
The first group in the list output is the current primary group for the user.
‘sudo lid “username” ‘ also works.
Which command can be used to temporarily change the primary group for the current user to ‘sales’ ?
newgrp sales
This will open a new shell, in which the new temporary primary group is set to ‘sales’ until the user logs out or uses the ‘exit’ command.
What are the numeric values of the read, write and execute permissions on Linux?
Read: 4
Write: 2
Execute: 1
Which command would allow the owner of the file ‘/somefile’ to read, write and execute, the group owner to read and execute and all others to read and execute?
chmod 755 /somefile
This uses ‘chmod’ in absolute mode which replaces all current permissions with the ones given as an argument.
Which command will give write permissions to the group owner of ‘/home/somefile’ and take away read permissions for all other users?
chmod g+w,o-r /home/somefile
This uses ‘chmod’ in relative mode when permissions can be added/subtracted from the already existing configuration.
Which command would give execute permissions to all three permission groups (users, groups, others) for every subdirectory inside ‘~/files’ in addition to the ‘~/files’ directory itself?
chmod -R a+X ~/files
The ‘a’ stands for all three permission groups. The ‘-R’ option recursively applies permissions to everything within the directory given. Lastly, the uppercase ‘X’ only sets execute permissions on the subdirectories rather than both the directories and the files.
Suppose there is an executable file named ‘/usr/bin/action’ and it is owned by the root user. Which command can be used to allow any user to run the executable file but only as the owner (root).
chmod u+s /usr/bin/action
’s’ means both execute and SUID are set while an uppercase ‘S’ would mean only SUID is set.
Suppose there is a shared directory ‘/accounting’ that is owned by the ‘accounting’ group. Which command would make it so that every file/subdirectory created inside ‘/accounting’ inherits the group ownership?
chmod g+s /accounting
’s’ means both SGID and execute are set while an uppercase ‘S’ would mean only SGID is set.
If just SGID is set on a file, then users would execute that file as the group owner.
Suppose there is a shared directory ‘/accounting’ that is owned by the ‘accounting’ group. Which command would make it so that only users who own a file/directory within ‘/accounting’ are allowed to delete them?
chmod +T /accounting
This is known as the sticky bit. This prevents users from deleting files from other users.
Which command will list the umask that is set for the current user?
umask
The ‘umask’ is subtracted from the maximum permissions of 666 for a file and 777 for a directory.
What steps would you take to change the default umask to 022 for every user?
- Create the ‘/etc/profile.d/umask.sh’ file.
- Add the line ‘umask 022’ and save the changes.
- On next login, the umask should be set to 022 for everyone.
A user-specific umask can be defined in the ‘~/.profile’ or ‘~/.bash_profile’ file.
Which command would make the memory used for the data in file ‘/somefile’ be written over with 0s after deletion?
chattr +s /somefile
The ‘+s’ attribute overwrites the blocks where the file was stored with 0s after the file has been deleted. This makes sure that recovery of the file is not possible after it has been deleted.
Attributes set via ‘chattr’ do their work regardless of the user who accesses the file.
Which command would make the file ‘/root/myfile’ immutable? This would prevent anyone from editing/deleting it, including the root user.
chattr +i /root/myfile
This attribute can be removed with ‘chattr -i’
Which command can be used to register a RHEL system?
subscription-manager register
This will prompt for the name of your Red Hat user account as well as your password, and after you enter these, your RHEL server will be registered.
Once registered, which command will subscribe the system and give access to updates for Red Hat products?
subscription-manager attach –auto
Which directory stores the ‘.repo’ files that are used to configure the server to use specific repositories?
‘/etc/yum.repos.d’
What five parameters are commonly found in a ‘.repo’ repository client file?
[label]
name=
baseurl=
enabled=
gpgcheck=
Suppose the contents of the RHEL 9 installation disk is copied to the ‘/repo’ directory. Which command would automatically create the repository client file for the BaseOS repository?
dnf config-manager –add-repo=file:///repo/BaseOS
Since the repository is installed locally, the ‘file://’ URI must be used. Ensure that the ‘gpgcheck’ parameter in the generated repository file is set to 0 to prevent dnf from doing GPG checks on incoming packages.
Which command will search through the package names and summaries for a provided keyword?
dnf search “keyword”
dnf search all “keyword”
The ‘dnf search all’ version of the command also searches through the large package descriptions in addition to the names/summaries.
Which command would look for the package containing the file ‘Containerfile’ ?
dnf whatprovides */Containerfile
dnf provides */Containerfile
dnf wp */Containerfile
All three of these commands provide the same output. The ‘*’ is used because these commands only look for full pathnames.
Which command will retrieve information on the ‘nmap’ package?
dnf info nmap
How would one list all packages that are installed on the server?
dnf list installed
Which command will update the kernel?
dnf update kernel
Unlike other ‘dnf update’ commands, updating the kernel will still keep the old version of the kernel around. During the boot process, you can choose which kernel version to use.
Which command would show information about the packages available in the group ‘Container Management’ ?
dnf group info “Container Management”
Which command would list all available package groups, including hidden subgroups?
dnf group list hidden
‘dnf group list’ only shows environment groups and not all subgroups.
Which command would allow you to undo the second action performed by dnf?
dnf history undo 2
When using ‘dnf history’ all dnf commands that were used by the user are listed. ‘dnf history undo’ then allows users to undo these actions.
Which command will show the repositories that the system is currently using?
dnf repolist
Which command would show all of the available streams for the ‘maven’ module?
dnf module list maven
Suppose you want to use the ‘maven’ module with stream 8.1. Which command would show the profiles available for that specific module/stream?
dnf module info maven:8.1
Which command would enable the 8.2 stream for the ‘maven’ module?
dnf module enable maven:8.2
By default, a specific module stream is enabled. This is the module stream that will automatically be used when installing packages. This can be changed with the ‘dnf module enable’ command.
After switching streams, it is a good idea to execute ‘dnf distro-sync’ to ensure that all dependent packages that are not in the module itself are updated as well.
Which command would find the name of the RPM package that the ‘/bin/ls’ command belongs to?
rpm -qf /bin/ls
The ‘-q’ option stands for query. This option tells the command to query the package database. The ‘-f’ option takes a filename as an argument and will find the specific RPM package a file belongs to.
Which command would query the specific RPM file ‘httpd- 2.4.6-19.el7.centos.x86_64.rpm’ to see whether it contains any scripts before installation?
rpm -qp –scripts httpd- 2.4.6-19.el7.centos.x86_64.rpm
The ‘-p’ option is used to query RPM packages instead of the local RPM package database. The ‘–scripts’ option uses the RPM database to show scripts that are used in the package.
When querying a package, you need to refer to the complete filename, including the version number and all other information. Additionally, the ‘rpm’ command can only perform this query on RPM packages on the local machine. (either they are already installed or downloaded)
Which command can be used to download the ‘zsh’ package from a repository to the current directory?
dnf download zsh
The ‘yumdownloader’ command from the ‘yum-utils’ package used to be used instead.
Which command can be used to query packages from the repositories before they have been installed?
repoquery
This command is included in the ‘dnf-utils’ RPM package.
Which command will simply list the current network settings?
ip a
ip a s
ip addr show
All three of the above commands will work. This command will list all network interfaces on the computer, along with some of their configuration details.
Which command would temporarily change the link state to UP for the ‘eno2’ interface?
ip link set dev eno2 up
Every configuration change made with the ‘ip’ command is non-persistent.
Which command will show the link state of all network interfaces along with current link statistics?
ip -s link show
Which command will list routing table information?
ip route show
Which command can list all TCP ports that are currently listening?
ss -lt
The ‘ss’ command stands for socket statistics. The ‘-l’ option specifies that only ‘Listening’ ports should be listed while the ‘-t’ option specifies that only TCP ports should be shown.
Another useful option is the ‘-n’ option which tells the command not to resolve service names but instead show actual numeric port numbers. For example, normally ‘ssh’ would be listed but the ‘-n’ option would show 22 instead.
Which command can show the status of the main network management service?
systemctl status NetworkManager
Which command will list all connections?
nmcli con show
Which command would create a new connection named ‘main-connection’ on interface ‘ens33’ that receives its IPv4 configuration dynamically via DHCP?
nmcli con add con-name main-connection type ethernet ifname ens33 ipv4.method auto
The ‘nmcli’ connection has great command-line completion to help in composing these longer commands. Just make sure the ‘bash-completion’ package is installed.
Suppose you have a static connection named ‘static-connection’ and you want to add a second IP address ‘10.0.0.62/24’ to its IPv4 configuration. Which command will accomplish this?
nmcli con mod static-connection +ipv4.addresses 10.0.0.62/24
Suppose you have a static connection named ‘static-connection’ and you wish to add a DNS server with the address ‘8.8.8.8’ to its configuration. Which command will accomplish this?
nmcli con mod static-connection ipv4.dns 8.8.8.8
Notice that while adding a network connection, you use ‘ip4’, but while modifying parameters for an existing connection, you often use ‘ipv4’ instead.