Macon User Group Linux SIG - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Macon User Group Linux SIG

Description:

Ubuntu has six virtual consoles, enabling the screen to be used for six ... In Ubuntu, the root account is disabled by default, in preference to sudo. ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 18
Provided by: jimsw
Category:
Tags: sig | group | linux | macon | ubuntu | user

less

Transcript and Presenter's Notes

Title: Macon User Group Linux SIG


1
Macon User Group Linux SIG
  • What is the Command Line?
  • (and why should I care?)?

2
The Command Line
  • A text-based mode of operating where commands are
    entered at a prompt.
  • A command line can be accessed from within a
    graphical environment as well as from virtual
    consoles.
  • Console is synonymous with terminal.
  • Ubuntu has six virtual consoles, enabling the
    screen to be used for six independent work
    sessions.

3
What Can You Do?
  • Perform routine tasks
  • Log in/out
  • Change passwords
  • Etc.
  • Implement basic file management
  • Execute basic system management

4
User-based Security 1
  • Ubuntu grants superuser privileges to the first
    account that is set up.
  • The superuser can modify the system, and make
    changes to any other user's account.
  • To use superuser privileges, enter sudo then
    the command.
  • The password must be entered every time. (There
    are ways to avoid this.)?
  • Other users can modify only their own accounts,
    and not the system.

5
User-based Security 2
  • sudo is not the same as root.
  • In Ubuntu, the root account is disabled by
    default, in preference to sudo.
  • If you want to get to a root shell (thereby
    removing the need to type sudo and the password
    every time) just enter sudo -i to get the root
    prompt (). To return to a normal prompt, type
    exit and press return. This does not create a
    root account, however.

6
What is a Command?
  • A command is an instruction to Linux to perform
    some operation.
  • Commands consist of one or more elements. The
    first element is always the actual com-mand,
    followed by parameters or options.
  • Options are prefixed with hyphens.
  • An important option is the --help option (with 2
    hyphens)?
  • Using this option displays all the options
    available for the command.

7
Important Commands in Linux
  • Most Linux commands are fairly mnemonic.
  • ls -- (list) shows the files in the current
    directory
  • Option -a (all) displays hidden files
  • Option -l (long) displays detailed description
  • Options can be combined ls -al
  • man -- displays the manual page for a command.
  • A detailed manual is available for all commands.
  • pwd -- returns name of present working directory

8
Getting to the Command Line
  • Go to Applications Accessories Terminal
  • Or, press Ctrl-Alt-F1
  • This gets you to one of the 6 virtual consoles
  • Use Alt-F1 thru Alt-F6 to cycle through Alt-left
    or -right cursor key does the same
  • Alt-F7 gets you back to Gnome

9
The Shell 1
  • A console in Ubuntu normally runs Bash the
    Bourne again shell, the most widely used
    derivative of the Bourne shell.
  • When you have opened the shell, you will be asked
    to log in, using your user name and the password
    supplied when the account was created.
  • The Ubuntu shell prompt is user_at_host
  • The tilde () indicates your home directory

10
The Shell 2
  • If you are root, the prompt changes from
    to .
  • The appearance of the prompt is governed by the
    environment variable PS1.
  • To see the contents of PS1, enter echo PS1
  • Use the export command to change PS1 temporarily
    export PS1/u will show only the username
    and the prompt.
  • Some values for options are shown in the handout.
  • Also see http//www.tidp.org/HOWTO/Bash-Prompt-HOW
    TO

11
File Navigation 1
  • Navigating through the file system
  • cd changes directories
  • cd /etc/apt moves you straight to that
    directory
  • cd .. moves up one level (note space before ..
    )?
  • cd takes you to your home directory from
    anywhere
  • So does cd
  • pwd tells you where you are in the file system
  • ls lists the contents of the current directory

12
File Navigation 2
  • More on ls
  • There are many options for use with this command
  • ls -a lists all files and directories in the
    current directory
  • ls -l shows permissions, sizes, groups, etc.
  • ls -al combines those options
  • ls -R scans and lists contents of all
    subdirectories. This may get long, so put the
    result into a text file with ls -R listing.txt.

13
File Management 1
  • Basic file management with the shell involves
    only a few easily remembered commands
  • cat filename outputs contents of filename to the
    display.
  • mv file1 file2 renames file1 as file2
  • mv file dir moves file to specified directory
  • cp file1 file2 creates file2 as copy of file1
  • rm file deletes the file
  • rmdir dir deletes dir (if it is empty)?

14
System Management 1
  • Permissions
  • Under Linux (like Unix) everything in the file
    system, including directories and devices, is a
    file.
  • Every file on your system has an accompanying set
    of permissions based on ownership.
  • Permissions are the basis for security under
    Linux they designate a file's read, write, and
    execute permissions for you, members of your
    group, and others who may have access to the
    system.

15
System Management 2
  • Do a long-format listing of some files
  • drwxr-xr-x 2 root root 4096 2008-09-23 1657 .
  • The first 10 characters are the permissions on
    this file
  • d indicates that this file is a directory
  • The next 3 are permissions for the owner rwx --
    read, write, and execute.
  • Characters 5 thru 7 are for group members, and 8
    thru 10 are for others. Note that both are r-x,
    where the hyphen indicates that these accounts do
    not have write capability in this directory.
  • The '2' indicates that there are 2 links to this
    file.

16
System Management 3
  • Continuing with this listing
  • drwxr-xr-x 2 root root 4096 2008-09-23 1657
  • 'root' is the owner, in the group named 'root'
  • 4096 is the size of the file in bytes
  • Then the date and time of creation is shown.
  • The chmod command allows changing the
    permissions only root and the owner can do this

17
System Management 4
  • Parameters to the chmod command are
  • Categories concerned u (user), g (group) and o
    (others)?
  • Characters for modification - (delete), (set),
    and (insert)?
  • The abbreviations r (read), w (write), and x
    (execute)?
  • Names of files to be modified, separated by
    spaces
  • To give write permission for 'others' on the file
    'foo', chmod ow foo
  • Other related commands are chown and chgrp, which
    let the owner (or root) assign files to other
    owners or groups.
Write a Comment
User Comments (0)
About PowerShow.com