Chapter 11.5 Linux File Management
You're using the vi editor to manage a text file on a Linux system. You want to type new text into the file; when you type you want the existing text that comes after the cursor to be pushed down? What mode do you need to be in to do this?
Insert Mode
You've just opened a text file in the vi editor and you're in Command Mode by default. There is more than one way to get from Command Mode to Replace Mode. Which of the following key-press sequences will get you into Replace Mode?
Press Insert, then press Insert again. Press the 'i' key, then press Insert. Press the 's' key, then press Insert.
You need to see what kind of CPU is being used on a Linux system. The /proc directory contains a text file called cpuinfo that will give you the information you're looking for. Which of the following commands will display the entire contents of the cpuinfo text file on the screen?
cat /proc/cpuinfo
You find that someone has set up an unauthorized account, with the username badmin, on the Linux server. You have disabled the account but you need to find out when and how this user has been gaining access to the system. The first step you decide to take is to inspect the contents of the /var/log/auth.log file to find information related to badmin logging into the system. Which command can you use to search through the auth.log for lines that contain the username you're looking for?
grep "badmin" /var/log/auth.log
You need to view the contents of /var/log/auth.log file to get information about the users that have been logging on to the system. The auth.log file is a plain text file so you decide to use the cat command to review the file. However, the display fills up with text for several pages and you can't see the entire file. What commands can you use to view the content of the auth.log file page by page?
more /var/log/auth.log less /var/log/auth.log
You are the administrator of a Linux server. Following best practices for system security and effective administration, you always login to the system with a standard non-root user account. You only elevate your privileges to root user level when you need to do an administrative task. What do you enter at the command prompt that will, by default, switch you to the root user and require you to enter the root password?
su -