1Z0-402 - Enterprise Linux Fundamentals

Go back to Oracle

Example Questions

You are writing a script and add the following line at the beginning of the script: #!/bin/bash What implications does this have on the shell script if the script is called directly at the c shell prompt? You log in as normal user bob and execute the mount command without any arguments. What would be the output of this command? You have issued the following command: echo -e welcome\nTo Oracle\nEnterprise\rLinux What would be the impact of -e switch on the echo command? Match the query commands with their functions. 1. rpm -qa a. lists packages on which the package depends 2. rpm -qi b. lists all packages installed on the system 3. rpm -qR c. list of all the files in the package 4. rpm -ql d. information about the package Which statements are true about xauth? (Choose all that apply.) As an administrator you want to make sure that accidentally you do not delete files using rm command. You also want to make sure that even the use of rm command without any valid switches prompts for confirmation before file deletion. Which option would help you achieve this task? You have logged in as user smith at tty1 terminal and issued the following incomplete command at the bash prompt: [[email protected] ~]# if [ i > j ] then > The shell displays the default secondary prompt ">". What would you do to make "=>" as the default secondary prompt temporarily only for user smith and for the tty1 terminal current session? As the root user, you try to log in to station1 from station2 using ssh but fail with an error message as shown below: [[email protected]]# ssh station1 [email protected]'s password : Permission denied, please try again. [email protected]'s password : Permission denied, please try again. [email protected]'s password : Permission denied, (publickey,gssapi-with-mic, password). [[email protected]]# What could be the possible reason for the error? Observe the following NFS share exported by server1. [[email protected] ~]$ cat /etc/exports /data .example.com(ro,root_squash) You have logged in as root on station1 and try to access the /data NFS share on server1 as root. Which statement holds true in this context? A group of users on a Linux system have a common working directory /documents with 1770 permissions. You have a scenario where you have to let all users of the group delete any file or directory in /documents. What would you do in this situation to let them delete any file or directory in /documents? The /data directory that belongs to the apps group is set with 1770 permissions. The details of the apps group members are given below. # groups smith bob scott smith : smith apps scott : scott apps bob : bob apps What are the effective permissions for each of these users on other users' files and directories in the /data directory? As a root user you want to modify the default shell prompt to include the hostname as part of the prompt. Also you want the change in the hostname to reflect on the prompt immediately. Which option would help you achieve this task? The root user tries to create the hard link link1 to /root/textfile in /boot and receives the error: [[email protected] ~]# ln textfile /boot/link1 ln: creating hardlink `/boot/link' to `textfile': Invalid cross-device link Which two statements are true? (Choose two.) Which three statements are true about tunneling an application through ssh? (Choose three.) The user smith , whose primary group is smith, would like to create a file in his home directory, which belongs to the group apps. Which two statements are correct? (Choose two.) The GNU project was started by Free Software Foundation (FSF) with a goal to create a free UNIX Clone. What do you understand by the term free as per the terms of FSF? You are planning to add the new printer1 print queue and also want to make it the default print queue. Which of the following two commands would help you achieve the task? (Choose two.) Note the following command executed by the user smith on server1. [[email protected] ~]$ groups apps smith sysgroup admins scott [[email protected] ~]$ touch file1 newfile [[email protected] ~]$ mkdir dir1 dir2 [[email protected] ~]$ ls dir1 dir2 file1 newfile What would be the default group of the files and directories created by user smith on server1? Which statement is true about the privileges granted to a user with the UID of 0? You have issued the following command: echo -e "Welcome\nTo Oracle\nEnterprise\rLinux" Why would you use the -e switch? (Choose two.) Match the process status with its definition. 1. Running a. Waiting for some event (for example, user input) 2. Stopped b. Child not properly reaped by parent 3. Sleeping c. Still loaded in memory, but not running 4. Zombie d. Currently being allocated CPU slices Match the following Regular Expression Quantifiers with their appropriate values: 1) * a) match 0 or 1 times 2) + b) match exactly n times 3) ? c) match at least n times 4) {n} d) match 0 or more times 5) {n,} e) match 1 or more times What would be the default permissions on files and directories created by a user with umask 027? As normal user scott you have generated version 2 dsa key pair using the ssh-keygen program. What are the default user permissions available for the private key? Which three statements are true about screen? (Choose three.) Note the command given below: ls -l | grep hello\.gif Which statement is true about this command? As user smith you want the CPU utilization of all the users logged on to server1 server. You want the information available automatically as soon as you login to the bash login shell and want the information available only to smith. What would you do on server1, which has all the default shell configuration files, to accomplish the task? You want to access data relevant to some running processes in the system. Which directory contains the system information describing the system and processes (for example, PID files) since the system was booted? Identify the true statement about AutoFS. You have opened a file called newfile.txt in the vi editor and in command mode, you enter :0,$ s/hello/init/g. What could be the purpose of issuing this command? The user smith issued the egrep "^[[:alnum:]]{4,}$" file1.txt | wc -l command. What would be the expected output from this command? Observe the following while loop: while true do echo " Welcome" sleep 5 done What does the while statement do in the script when the condition is true? Identify the program that runs with the real and effective UID and GID of the switched user when you switch from one user to another using su command. The Linux file system contains a directory by default on which all users have rwx permissions. Only the root user has the permission to delete any file created by any user. Identify the directory and find out why it is so. You want to secure the server1 server by denying root access through ssh. Which file would you edit on server1 to achieve this task? The user smith has issued the command: cut -f1,3 -d: /etc/passwd | tr a-z A-Z > file1.txt What could be the purpose of using this command? User smith on station2 is trying to chat with the remote user bob on station1 using the talk command. smith receives an error message as shown below: [[email protected] ~]$talk [email protected] [No connection yet] [ Error on read from talk daemon: Connection refused ] [[email protected] ~]$ What can the root user do to resolve the issue? (Choose two.) You have logged in as a normal user bob and use write and wall to chat with other users. How are you able to chat with other user terminals? Which file compression standards are recognized and could be decompressed by gunzip? (Choose all that apply.) You have downloaded a DOS-formatted text file through anonymous ftp using binary transfer mode to your Linux machine. What impact does this have on the downloaded text file? You want to archive a directory and its subdirectories (excluding a list of subdirectories from a file) using the tar command. Which option would help you to do this? The user bob on station1 wants to chat using talk with smith on station2 in the same network. Identify the statement that holds true in this scenario. You have logged in at the tty1 terminal on your local machine and want to display all the child processes that have an associated terminal. Which command would help you achieve this task? You have logged in as normal user bob with the default login shell. An attempt by bob to change the default shell to /bin/sh fails with an error. What could be the possible reason? Identify the two true statements about FTP servers. (Choose two.) Which command could user smith use to change the time stamps of the file1 and dir1 given below, to the current system time? [[email protected] ~]$ ls -l -rw-rw-r-- 1 smith smith 6 Jan 20 10:01 file1 drwxrwxr-x 2 smith smith 4096 Jan 20 10:54 dir1 Which command gives the following output? Date 03/12/2007, Time 12:00:01 AM A new user smith wants to customize the bourne shell by creating a new alias for the ls -l command. He wants to make the new alias persistent across logouts and also reboots. What could be done to make the new alias persistent only for smith? Observe the script below: echo " Enter your name : " read name echo " Hello $name , Good Morning. " What does read do in this script? (Choose all that apply.) Which statement is true about a normal user created with UID less than 500?

Study Guides