430 likes | 633 Views
Lesson 9-Linux. Overview. Introduction to Linux. Working with Linux. Managing files and folders in Linux. Using the Gnome desktop. Configuring Linux. Troubleshooting common Linux problems. Introduction to Linux.
E N D
Overview • Introduction to Linux. • Working with Linux. • Managing files and folders in Linux. • Using the Gnome desktop. • Configuring Linux. • Troubleshooting common Linux problems.
Introduction to Linux • Linus Torvalds developed an open source version of UNIX, called Linux, in 1991. • Open source software is software that is distributed with all its source code, and can be customized by the user as required. • Slack Ware and Red Hat Linux versions included C++ compilers, TCP/IP functionality, and primitive Web servers.
Introduction to Linux • Benefits of Linux. • Drawbacks of Linux.
Benefits of Linux • All versions of Linux can be freely downloaded from the Web. • Linux can run on older equipment. • Linux programs are very efficient, lean, and use lesser resources.
Benefits of Linux • Linux codes, being well written, provide higher speeds and better stability to the operating system. • Linux is an open source software, implying that the source code can be read and modified as required.
Drawbacks of Linux • The source code can be read as Linux is an Open Source License. This leads to easy hacking of the system. • Linux is compatible only with limited software and hardware. • Linux does not provide extensive documentation and support to fix vulnerabilities. • Linux is difficult to use.
Working With Linux • Access to Linux. • DOS versus Linux. • Logoff and shutdown in Linux.
Access to Linux • Authenticated login using a Linux account is required to access a Linux system. • The Linux prompt will be shown only if the authentication information is right. • The Linux prompt includes the user name, followed by a @machine name.
Access to Linux • The Linux command syntax is very basic, and starts with a Linux command separated by spaces, and followed by optional parameters and switches. • A switch changes the way a command runs.
DOS versus Linux • Case sensitivity – DOS is case-insensitive, while Linux is case-sensitive. • Switches – DOS switches start with a slash (/), and Linux switches start with a hyphen (-). • Spaces – DOS commands can work with or without a space, while all parts of the Linux command line must be separated by a space.
DOS versus Linux • Path – DOS uses the backslash (\) character to indicate a path to a folder, and Linux uses the forward slash (/) to indicate a path to a folder. • Output – DOS provides a very descriptive output, while Linux provides only the minimum output.
Logoff and Shutdown in Linux • The exit command or the CTRL-D key combination can be used to log out of Linux. • The shutdown –h now command is used to shut down the Linux machine immediately, and halt after shutting down. • The –r switch can be used with the command to reboot the Linux system after shutdown.
Managing Files and Folders in Linux • Listing the contents of a folder. • Creating a file with Pico. • Displaying the contents of a file. • Copying files in Linux.
Managing Files and Folders in Linux • Deleting a file in Linux. • Renaming or moving files in Linux. • Working with folders in Linux. • Changing file permissions.
Listing the Contents of a Folder • The ‘ls’ command is used to list the contents of a folder. • By default, the ls command only provides the names of visible files in the current folder.
Listing the Contents of a Folder File Management Commands
Creating a File With Pico • Linux treats folders, Web pages, and even devices as files. • Text editors are required to write a file. • Pico is the easiest editor to use and provides a series of commands at the bottom of the screen.
Creating a File With Pico Common Pico Commands
Displaying the Contents of a File • The ‘more’ command displays the contents of a file one page at a time. • The ‘head’ command displays the first ten lines of a file. • The ‘tail’ command displays the last ten lines of a file. • The ‘cat’ command displays the entire contents of a file.
Copying Files in Linux • The ‘cp’ command is used for copying files. • The command requires two parameters – the source file and the destination where the file has to be copied.
Deleting a File in Linux • The ‘rm’ command is used for deleting a file. • The command requires at least one parameter – the name of the file to be deleted.
Renaming or Moving Files in Linux • The ‘mv’ command is used to rename a file or to move a file from one folder to another. • The command required two parameters – the name of the original file and the new name or location of the file.
Working With Folders in Linux The folder structure in Linux is divided into two types: • Folders that can be changed, called home folders. • Folders that cannot be changed, and often consisting of system folders like /etc and /bin.
Working With Folders in Linux • /home/username is the home directory path, if Linux is installed with the defaults. • The /bin folder contains many of the Linux commands. • The /etc folder contains the settings and configuration data for Linux.
Working With Folders in Linux • The ‘mkdir’ command is used to create a folder. • The ‘mkdir’ command requires at least one parameter – the name of the folder to be created.
Working With Folders in Linux • The ‘cd’ command is used to change a directory. • The cd command requires only one parameter – the name of the folder. • The ‘pwd’ (print working directory) command can be used to print the path to the current folder.
Changing File Permissions • The mode of a file must be changed to implement security for that file. • The ‘chmod’ command is used for changing a file’s mode. • The command requires two parameters – the access mode number and the file to change.
Changing File Permissions The chmod Permissions
Using the Gnome Desktop • The Gnome desktop is a version of X Windows. • The ‘startx’ command is used for starting the Gnome. • The Gnome uses the Gnome Windows Manager to keep applications open and make them easily accessible.
Configuring Linux • Root login is required to make changes to the Linux system. • A user who has logged in as a regular user can log in as a root user without logging out, using the ‘su root’ command. • The ‘su’ stands for substitute user.
Configuring Linux • Managing users. • Configuring a printer.
Managing Users Creating users: • The ‘useradd’ command is used to create a user. • The command requires at least one parameter – the name of the user to be added. • Several users can be added at a time using the syntax ‘useradd username1, username2, username3’ • The ‘finger’ command can be used find a user name.
Managing Users Changing user passwords: • The ‘passwd’ command can be used for changing a user’s password. • The command does not require any additional parameters. • Root login is required to change a user’s password.
Managing Users Deleting users: • The ‘userdel’ command can be used to remove a user from the Linux account. • The syntax used is – userdel username
Configuring a Printer • Printtool is a command-line program that starts a GUI configuration program for the printers. • Printtool allows the user to select the printer and the port to which the printer is attached. • In Linux, the port for the printers is represented by /dev/lp0.
Troubleshooting Common Linux Problems • The Xconfigurator program can be used to properly configure the video card and monitor, thereby preventing Gnome startup problems. • Ensure that necessary changes are made to the /etc/inittab file to log in from the Gnome instead of the command-line.
Troubleshooting Common Linux Problems • The problem of screen gibberish can be resolved by simply logging off. • The help program in Linux can be used to provide additional information on the required topics.
Summary • Linux is free, stable, and open source software. • A root login is required to shut down the Linux system. • File management is crucial since everything in Linux is treated as a file.
Summary • The ‘man’ command can be used to provide a complete list of switches associated with a particular command. • Read, write, and execute are the permissions available on files. • Gnome is an X Windows version.