9 Linux on the Desktop
Learning Outcomes Describe Linux and its origins and list benefits and drawbacks Select, acquire, and install a distribution of Linux for the desktop Identify certain features and utilities in a Linux GUI for customizing it and performing common tasks Demonstrate the use of shell commands to accomplish common tasks Secure a Linux desktop by creating user accounts, assigning passwords, and applying file and folder permissions
Linux Overview LO 9.1
Why Learn Linux? Qualifying for a Job Improving Your Skills
Why Learn Linux? Year Event 1970s Ken Thompson of Bell Labs writes precursor to UNIX 1984 GNU created to develop a free UNIX-like OS 1988 UNIX licensees form the Open System Foundation (OSF) 1991 Linus Torvalds begins writing open-source version of a UNIX-like OS 1994 Many versions of Linux kernels freely available
Linux Today Open-source movement growing Supported by many organizations Open-source Apache HTTP Server Written for UNIX Also runs on Linux
Linux Distributions Include kernel Include bundled programs Add functionality to Linux Targeted bundled apps Desktop Server
Benefits of Linux Many distributions are free Runs well on old computers Fast GUI optional Stable Secure Open source
The KDE GUI Figure 9-1 The KDE GUI in a Fedora installation.
The Unity GUI Figure 9-2 The Unity GUI in an Ubuntu installation.
Drawbacks of Linux Lack of Centralized Support Choice of GUIs is confusing Limited software selection Limited hardware support Complexity
Finding Software for Linux Figure 9-3 The Ubuntu Software Center
Linux on Your Desktop LO 9.2
Acquiring Linux for the Desktop Many distributions available Select one that matches your needs Example of needs: GUI desktop Quick and easy setup Included software bundle Live image Ubuntu or Fedora
Installing Linux for the Desktop Connect to distribution site and download Save the ISO file Create a bootable disc Test the disc by rebooting Install on physical PC or virtual machine
Update Linux after Installation Linux distributions can have many updates Updating is time-consuming
Exploring a Linux GUI LO 9.3
Logging In to Ubuntu Linux Figure 9-4 Log in to the Linux GUI.
The Ubuntu Unity Desktop The Ubuntu Desktop bar displays at the top of the screen in the Unity GUI. Move the cursor to the Desktop bar to show the menus.
Ubuntu Unity Launcher Figure 9-5 The Launcher with icons labeled.
Searching in the Ubuntu Unity Desktop Figure 9-6 The Dash search utility displays recently used apps and files when it opens.
Browse Directories in the GUI Every user has a home directory User has full control in home User cannot make changes in other directories Path describes location of file or directory First forward slash (/) is the root Subsequent forward slashes separate directories Everything is a file to Linux
Table 9-1 Linux Default Directories Directory Purpose or Contents / The top, or root directory of a storage volume /bin Linux commands /boot Files to be loaded during Linux boot up /dev Files that represent physical devices /etc Linux system configuration files /home Home directories for each user /lib Shared libraries for programs and commands to use /mnt Mount points for removable devices /opt Optional (add-on) software packages /proc Current status of processes /root Root account home directory /sbin System commands and binary files /tmp Temporary files /usr Secondary hierarchy /var Several directories containing variable data
Updating Ubuntu The Update Manager icon appears on the Launcher. Open the Update Manager and install the updates.
System Settings Unity’s System Settings window serves the same purpose as Windows’ Control Panel and OS X’s System Preferences.
Modify the Desktop Right-click empty area of desktop Select Change Desktop Background Behavior tab controls how Launcher opens Select wallpaper Control Brightness and Lock settings Modify display settings Universal Access for ease of use
Ending a Linux Session by Logging Out Open System menu (gear) Select Log Out Figure 9-7 The Ubuntu Unity System menu.
Switching Users Click User icon The User menu opens Select User
Shutting Down, Restarting, or Suspending Linux Open System menu (gear) Select Shut Down
Linux Command-Line Interface LO 9.4
The Terminal Window in Linux Figure 9-8 A terminal windows in the Ubuntu GUI.
Linux Shell Command Syntax Each line begins with a command A space follows the command Options for a command follow Order of options not important Use a space between each option
Linux Shell Command Syntax (continued) Precede short options with a hyphen Precede long options with 2 hyphens Combine multiple short options Some commands followed by name of object
Looking at the Contents of a Directory Figure 9-9 The ls command showing a simple listing of the current directory. Figure 9-10 The ls -a command showing a listing of all items in the current directory.
Combining Shell Command Options Figure 9-11 The ls command using two options (-a and -l) showing a listing of all items in the current directory and the “long” information on each item.
The Help Manual for a Linux Command Figure 9-12 Enter the man ls command to see the manual page for the ls command.
Command-Line History Saved for current session in .bash_history Scroll through commands and reuse
Command Completion Type command and press Tab key Completes file and directory names
The date and cal Commands
Linux Feedback A message appears only if a command causes an error.
Table 9-2 Basic Shell Commands for File Management Description cd Changes current directory chmod Changes the mode or file permissions cp Copies a file ls Lists directory contents mkdir Makes a directory more Displays a text file, one screenful at a time pwd Prints the working directory rm Deletes indicated file
Table 9-3 Commonly Used Options for the ls Command ls Option Description -a Lists all files in the directory, including hidden files. Files are hidden by making the first character a period: .bash_profile -l Displays a long listing of the directory contents with all file attributes and permissions listed -F Classifies the listed objects. Directory names have a / character after the name. -S Sorts the output by size -t Sorts the output by time
A Listing of the /etc directory Figure 9-13 A listing of the /etc directory.
A Listing of the /etc directory with more details Figure 9-14 A listing of the /etc directory with more details.
Changing the Current Directory Figure 9-15 Changing to the /usr/sbin directory.
Changing to the Home Directory Figure 9-16 Changing to the Home directory using the tilde (~).
Where am I? Use the pwd command to display the path to the current directory.
Relative Path Figure 9-17 Use the command cd .. to move to the parent directory of the current directory (up one level).
Using Wildcards Figure 9-18 A portion of the results of the command ls [c-d]* when run from the /etc directory.
Creating Directories Figure 9-19 Use mkdir to create directories and ls to confirm that they were created.
Copying Files Figure 9-20 Copying the hosts file from the /etc directory to the user’s home directory.
Securing a Linux Desktop LO 9.5
Home Directories Each account has home directory User’s name assigned to directory User has full control of home directory
The Linux Root Account All-powerful account Only used when absolutely necessary Disabled by default Administrator can temporarily use root
Creating User Accounts in a Linux GUI User Accounts in System Settings First account create is Administrator type Subsequent can be Administrator or Standard Administrator can create new accounts Temporarily given ability to create accounts Must provide Administrator’s credentials
Temporarily Using Root Privileges Administrator-Type User Temporarily takes root account privileges Precede command with sudo (Superuser do) When prompted, enter administrator’s password Root privileges granted for five minutes
Using Root Privileges to Install Software Installing the finger daemon.
Table 9-4 Shell Commands for User Management Description useradd Adds a user to the system userdel Removes a user from the system passwd Changes a user’s password finger Finds a username
Creating a User with useradd Figure 9-21 Create a user with the useradd command. Confirm its creation with the finger command.
Changing User Passwords Change own password Enter passwd command alone Provide password Change password for another account Enter sudo passwd <username> Enter new password
Deleting Users Enter sudo userdel <username> Delete files in user’s home directory Delete user’s home directory Enter rmdir <directoryname> Enter rm –rf <directory-or-file-name>
File and Folder Permissions Figure 9-22 A sample listing showing attributes.
Table 9-5 Access Mode Numbers Permission Value Read 4 Write 2 Execute 1