A user interface, or UI, refers to the software that allows a person to interact with the computer. The UI provides the look and feel of the system, and determines how easily and efficiently it can be used. ( Note that ease of use and efficiency are not the same! )
The term "MS Windows" refers to a specific proprietary operating system, and implies all of the features of that system including the API and the UI. When people think of Windows, they think of the Start menu, the Control Panel, etc. Likewise, "Macintosh" refers to a specific product and invokes images of the "Dock" and a menu bar at the top of the screen rather than attached to a window.
The term "Unix", on the other hand, implies an API, but does not imply a specific UI. There are many UIs available for Unix systems. In fact, a computer running Unix can have multiple UIs installed, and each user can choose the one they want when the log in.
A Graphical User Interface, or GUI (pronounced goo-ee), is a user interface with a graphical screen, and icons and menus we can select using a mouse or a touch screen.
There are many different GUIs available for Unix. Some of the more popular ones include KDE, Gnome, XFCE, LXDE, OpenBox, CDE, and Java Desktop.
If you have access to a Unix GUI, log into your Unix system via the GUI interface now.
All Unix GUIs are built on top of the X11 networked graphics API. As a result, all Unix systems have the inherent ability to display graphics on other Unix systems over a network. I.e., you can remotely log into another Unix computer over a network and run graphical programs that display output wherever you're sitting.
This is not the same as a remote desktop system, which mirrors the console display on a remote system. Unix systems allow multiple users in different locations to run graphical programs independent of each other. In other words, Unix supports multiple independent graphical displays on remote computers.
It is also not the same as a terminal server, which opens an entire desktop environment on a remote display.
With Unix and X11, we can have individual applications running on multiple remote computers displayed on the same desktop. Doing so is easy and requires no additional software to be installed.
Most Unix GUIs support multiple virtual desktops, also known as workspaces. Virtual desktops allow a single monitor to support multiple separate desktop images. It's like having multiple monitors without the expense and clutter. The user can switch between virtual desktops by clicking on a panel of thumbnail images, or in some cases by simply moving the mouse over the edge of the screen.
Mac OS X is Unix compatible, derived largely from FreeBSD and the Mach kernel project, with components from GNU and other Unix-based projects.
It differs from more traditional Unix systems like BSD and Linux, though, in that it runs Apple's proprietary graphical API and GUI. Native OS X programs don't use the X11 API, but OS X can also run X11-based programs with the XQuartz add-on. See Section 1.19, “Remote Graphics” for instructions on enabling X11 for Mac.
There are two basic types of user interfaces:
A GUI is a type of menu-driven interface, where the menu items may be text or graphical icons. Some menu systems are simply text selected by entering a number on the keyboard.
___ __ ___ __ _ / | __ __/ /_____ / | ____/ /___ ___ (_)___ / /| |/ / / / __/ __ \ / /| |/ __ / __ `__ \/ / __ \ / ___ / /_/ / /_/ /_/ / / ___ / /_/ / / / / / / / / / / /_/ |_\__,_/\__/\____/ /_/ |_\__,_/_/ /_/ /_/_/_/ /_/ _________________________________________________________ Portable Command-line Systems Management https://acadix.biz/auto-admin.php _________________________________________________________ This menu system encompasses only a small fraction of the total auto-admin functionality. To see what else is available via the command-line, choose "List available auto-admin scripts" below. Full documentation is in the works and will be included in a future release. 1.. Update system 2.. User management 3.. Software management 4.. Network management 5.. Power management 6.. File system actions and settings 7.. Security settings 8.. System settings 9.. Services manager 10.. List available auto-admin scripts Q.. Quit Selection?
While all modern Unix systems have GUIs, much Unix work is still done via the command line interface (CLI). A CLI requires the user to type in commands, rather than select them from a menu, much like short-answer questions vs multiple choice.
Menu-driven systems are easier to use if the system has limited functionality and you're new to the system or use it infrequently. However, menus are cumbersome where there is too much functionality to offer in a simple menu. Even simple menu systems can become cumbersome for everyday use.
If a user needs access to dozens or hundreds of features, they cannot all be displayed on the screen at the same time. Hence, it will be necessary to navigate through multiple levels of menus or screens to find the functionality you need. Doing this repeatedly becomes annoying rather quickly. A command line interface, on the other hand, provides instant access to an unlimited number of commands.
An ATM (automatic teller machine) is a good candidate for a menu interface. It has only a few functions and people don't use it every day. An ATM with a command-driven interface would likely be unpopular among banking customers.
You might be surprised to learn that CAD (Computer Aided Design) systems have CLIs. While CAD is inherently graphical in nature, CAD users cannot efficiently access their vast functionality through menus. Most CAD users quickly learn to use the CLI to draw, move, and edit objects via keyboard commands.
Because menu systems slow us down, most support hot keys, special key combinations that can be used to access certain features without navigating the menus. Hot keys are often shown in menus alongside the features they activate. For example, Command+q can be used on macOS and Ctrl+q on Windows and most Unix GUIs to terminate many graphical applications, as shown in Figure 1.1, “Hot Keys”.
It is also difficult to automate tasks in a menu-driven system. Some systems have this capability, but most do not, and the method of automating is different for each system. Command-driven interfaces are easy to automate by placing commands in a script, a simple text file containing a sequence of commands that might otherwise be run directly via the keyboard. Scripting is covered in Chapter 2, Unix Shell Scripting.
Perhaps the most important drawback of menu-driven systems is non-existence. Programming a menu system, and especially a GUI, requires a lot of grunt-work and testing. As a result, the vast majority of open source software does not and never will have a GUI interface. Open source developers generally don't have the time or programming skills to build and maintain a comprehensive GUI interface.
If you lack command-line skills, you will be limited to using a small fraction of available open source software.
In the tight competition for research grants, those who can use the command-line more often win.
The small investment in learning a command line interface can have a huge payoff, and yet many people try to avoid it. The result is usually an enormous amount of wasted effort dealing with limited and poorly designed custom user interfaces before eventually realizing that things would have been much easier had they learned to use the command line in the first place. It's amazing how much effort people put into avoiding effort...
A shell is a program that provides the command line interface. It inputs commands from the user, interprets them, and executes them. Using a shell, you type a command, press enter, and the command is immediately executed.
The word "shell" comes from the view of Unix as three layers of software wrapped around the hardware:
All that is needed to use a Unix shell is a keyboard and a screen. In the olden days, these were provided by a simple hardware device called a terminal, which connected a keyboard and screen to the system through a simple communication cable. These terminals typically did not have a mouse or any graphics capabilities. They usually had a text-only screen of 80 columns by 24 lines, and offered limited capabilities such as moving the cursor, scrolling the screen, and perhaps a limited number of colors, usually 8 or 16.
Hardware terminals lost popularity with the advent of cheap personal computers, which can perform the functions of a terminal, as well as running programs of their own. Terminals have been largely replaced by terminal emulators. A terminal emulator is a simple program that emulates an old style terminal within a window on your desktop.
All Unix systems come with a terminal emulator program. There are also free terminal emulators for Windows, which are discussed in Section 1.5, “Logging In Remotely”.
For purists who really want to emulate a terminal, there's Cool Retro Terminal (CRT for short, which also happens to stand for cathode ray tube). This emulator comes complete with screen distortion and jitter to provide a genuine nostalgic 1970s experience.
Once you're logged in and have a shell running in your terminal window, you're ready to start entering Unix commands.
The shell displays a shell prompt, such as "FreeBSD coral.acadix bacon ~ 1011:" in the image above, to indicate that it's waiting for you to enter the next command. The shell prompt can be customized by each user, so it may be different on each Unix system you use.
For clarity, we primarily use the following to indicate a shell prompt in this text:
shell-prompt:
To enter a Unix command, you type the command on a single line, edit if necessary (using arrow keys to move around), and press Enter or Return.
We can also enter multiple Unix commands on the same line separated by semicolons.
Modern Unix shells allow commands to be extensively edited. Assuming your terminal type is properly identified by the Unix system, you can use the left and right arrow keys to move around, backspace and delete to remove characters (Ctrl+h serves as a backspace in some cases), and other key combinations to remove words, the rest of the line, etc. Learning the editing capabilities of your shell will make you a much faster Unix user, so it's a great investment of a small amount of time.
If you have access to a Unix system now, do the practice break below. This practice break is offered again in Section 1.5, “Logging In Remotely” for those who will be using a remote Unix system.
Remotely log into another Unix system using the ssh command or PuTTY, or open a shell on your Mac or other Unix system. Then try the commands shown below.
Unix commands are preceded by the shell prompt "shell-prompt: ". Other text below refers to input to the program (command) currently running. You must exit that program before running another Unix command.
Lines beginning with '#' are comments, and not to be types.
# List files in the current working directory (folder) shell-prompt: ls shell-prompt: ls -al # Two commands on the same line shell-prompt: ls; ls /etc # List files in the root directory shell-prompt: ls / # List commands in the /bin directory shell-prompt: ls /bin # Create a subdirectory shell-prompt: mkdir -p Data/IRC # Change the current working directory to the new subdirectory shell-prompt: cd Data/IRC # Print the current working directory shell-prompt: pwd # See if the nano editor is installed # nano is a simple text editor (like Notepad on Windows) shell-prompt: which nano If this does not report "command not found", then do the following: # Try the nano editor shell-prompt: nano sample.txt # Type in the following text: This is a text file called sample.txt. I created it using the nano text editor on Unix. # Then save the file (press Ctrl+o), and exit nano (press Ctrl+x). # You should now be back at the Unix shell prompt. # Try the "vi" editor # vi is standard editor on all Unix system. It is more complex than nano. shell-prompt: vi sample.txt Type 'i' to go into insert mode Type in some text Type Esc to exit insert mode and go back to command mode Type :w to save Type :q to quit shell-prompt: ls # Echo (concatenate) the contents of the new file to the terminal shell-prompt: cat sample.txt # Count lines, words, and characters in the file shell-prompt: wc sample.txt # Change the current working directory to your home directory shell-prompt: cd shell-prompt: pwd # Show your login name shell-prompt: id -un # Show the name of the Unix system shell-prompt: hostname # Show operating system and hardware info shell-prompt: uname -a # Today's date shell-prompt: date # Display a simple calendar shell-prompt: cal shell-prompt: cal nov 2018 # Simple math with unlimited precision shell-prompt: bc -l scale=50 sqrt(2) 8^2 2^8 a=1 b=2 c=1 (-b+sqrt(b^2-4*a*c))/2*a 2*a quit # Show who is logged in and what they are running shell-prompt: w shell-prompt: finger # Exit the shell (which logs you out from an ssh session) # This can also be done by typing Ctrl+d, which is the ASCII/ISO # character for EOT (end of transmission) shell-prompt: exit
Make sure you are using the latest version of this document.
Carefully read one section of this document and casually read other material (such as corresponding sections in a textbook, if one exists) if needed.
Try to answer the questions from that section. If you do not remember the answer, review the section to find it.
Write the answer in your own words. Do not copy and paste. Verbalizing answers in your own words helps your memory and understanding. Copying does not, and demonstrates a lack of interest in learning.
Check the answer key to make sure your answer is correct and complete.
DO NOT LOOK AT THE ANSWER KEY BEFORE ANSWERING QUESTIONS TO THE VERY BEST OF YOUR ABILITY. In doing so, you would only cheat yourself out of an opportunity to learn and prepare for the quizzes and exams.
Important notes:
Show all your work. This will improve your understanding and ensure full credit for the homework.
The practice problems are designed to make you think about the topic, starting from basic concepts and progressing through real problem solving.
Try to verify your own results. In the working world, no one will be checking your work. It will be entirely up to you to ensure that it is done right the first time.
Start as early as possible to get your mind chewing on the questions, and do a little at a time. Using this approach, many answers will come to you seemingly without effort, while you're showering, walking the dog, etc.
What is a UI?
What is a GUI?
What is the difference between Unix and other operating systems with respect to the GUI?
How is Unix + X11 different from remote desktop systems and terminal servers?
What is a virtual desktop?
What are the two basic types of user interfaces? Which type is a GUI?
What is a CLI?
What types of applications are better suited for a menu-driven interface? Why?
What types of applications are better suited for a command-driven interface?
Which is easier to automate, a menu-driven system or a CLI? Why?
How many scientific programs offer a menu-driven interface? Why?
What is a shell?
What is a kernel?
What are libraries? What kinds of functionality do they provide?
What is a terminal?
What is a terminal emulator?
Do people still use hardware terminals today? Explain.
What is a shell prompt?