CSS307-System Programming Suleyman Demirel University Fall 2014 by - - PowerPoint PPT Presentation

css307 system programming
SMART_READER_LITE
LIVE PREVIEW

CSS307-System Programming Suleyman Demirel University Fall 2014 by - - PowerPoint PPT Presentation

CSS307-System Programming Suleyman Demirel University Fall 2014 by Konstantin Latuta & EN3([ABCDEF]|KZ)04 Week03 GUI review and Introduction to Week03 GUI review and Introduction to Command Line Command Line Learning Goals


slide-1
SLIDE 1

CSS307-System Programming

Suleyman Demirel University Fall 2014

by Konstantin Latuta & EN3([ABCDEF]|KZ)04

slide-2
SLIDE 2

Week03 – GUI review and Introduction to Week03 – GUI review and Introduction to Command Line Command Line

  • Learning Goals

– Learning some HowTos's of GNOME and Ubuntu 14.04 – Learning basic Linux shell commands and concepts

slide-3
SLIDE 3

GNOME Desktop Environment

  • GNOME is a popular desktop

environment that is default for many distributions

  • Alternatives:

– KDE – Unity (based on GNOME) – Xfce – LXDE

  • Display manager for GNOME is gdm.

Others are lightdm (by Ubuntu) and kdm (KDE)

slide-4
SLIDE 4

GNOME desktop on

  • lder

Ubuntu, may be 10.04

slide-5
SLIDE 5
slide-6
SLIDE 6

HowTo's using GUI

  • Login/Logout, suspend, shutdown...
  • Locking (Ctrl+Alt+L), account switching...
  • Default Applications...
  • Locating Applications: press dash and write what you are looking for...
  • User directories /home/user
  • Nautilus shortcuts, Ctrl+1, Ctrl+2, Ctrl+L, Ctrl+H …
  • Alt+F2 to run a command...
  • Ctrl+Alt+T to invoke terminal...
  • Deleting files … ~/.local/share/Trash/files
  • Changing appearance...
slide-7
SLIDE 7

Date and Time

  • Network Time Protocol (NTP) - is the most popular and reliable

protocol for setting the local time via Internet servers

  • Detailed configuration should go here: /etc/ntp.conf
slide-8
SLIDE 8

Network Manager

  • Network Manager utility was developed to make things easier

and more uniform across distributions

  • Supports many VPN technologies

– PSec, Cisco OpenConnect,

Microsoft PPTP and OpenVPN.

slide-9
SLIDE 9

Installing and Updating Software

  • A package in a Linux

distribution provides one piece

  • f the system, such as the

Linux kernel, the C compiler, the shared software code for interacting with USB devices,

  • r the Firefox web browser
  • Packages are often dependent
  • n other packages...
slide-10
SLIDE 10

Debian Package Management

  • dpkg - can install, remove, and

build packages but can not automatically download and satisfy all dependencies.

  • apt (Advanced Package Tool) – a

higher level package management system... generally tools are build upon it like apt-get, aptitude, synaptic, Ubuntu Software Center, Update Manager

slide-11
SLIDE 11

Red Hat Packet Manager

slide-12
SLIDE 12
  • penSUSE’s YaST Software Management
slide-13
SLIDE 13

Command Line Prompt

  • Linux System Administrators spend their lives at a command line

prompt (terminal emulator or virtual terminal)

  • Advantages:

– No GUI overhead. – Virtually every task can be accomplished using the command line. – You can script tasks and series of procedures. – You can log on remotely to networked machines anywhere on the Internet. – You can initiate graphical apps directly from the command line.

slide-14
SLIDE 14

Terminal Emulator

  • A terminal emulator program

emulates (simulates) a stand alone terminal within a window on the desktop

gnome-terminal

xterm

konsole

Terminator

  • To launch your default terminal

press Ctrl-Alt-T in Ubuntu

slide-15
SLIDE 15
  • You can drop X Window

graphical interface or start it up again, as you wish..

  • Ubuntu distinguishes

between servers (without X) and desktops (with X)

The X Window System

slide-16
SLIDE 16

Virtual Terminals

  • VTs are console sessions that use

the entire display and keyboard

  • utside of a graphical environment
  • “virtual” because although there can

be multiple active terminals, only one terminal remains visible at a time..

  • One virtual terminal is reserved for

the graphical environment

– VT7 in Ubuntu and VT1 in

CentOS/RHEL and openSUSE

slide-17
SLIDE 17

The Command Line

  • Command

name of the program you are executing ls -a Desktop

  • Options

switches to modify what the command may do

Usually start with one or two dashes ls -a Desktop ls --all Desktop

  • Arguments

Represent what the command operates on ls -a Desktop

slide-18
SLIDE 18

Turning off GUI :)

  • sudo service gdm stop

– most GNOME desktops

  • sudo service lightdm stop

– Ubuntu

  • sudo telinit 3

– RPM-based, like openSUSE or CentOS

slide-19
SLIDE 19

basic operations in the shell terminal

slide-20
SLIDE 20

Rebooting and Shutting Down

  • halt, poweroff

shutdown -h

  • reboot

shutdown -r

  • shutdown -h 10:00 "shutting down for scheduled

maintenance"

slide-21
SLIDE 21

Locating Applications

slide-22
SLIDE 22

Accessing Directories

  • pwd displays present working directory (echo $PWD also

works)

  • echo $HOME shows your home directory = default place

where you end up after logging in.

  • cd ~ or cd changes to your home directory
  • cd .. changes to parent directory
  • cd - changes to previous directory
slide-23
SLIDE 23

Absolute vs Relative Paths

  • Absolute paths always start with /

/home/konst/Desktop/hello.cpp /home////konst//Desktop/hello.cpp is also valid ...

  • Relative pathname starts from the present working directory

. present directory .. parent directory ~ your home directory ../../Desktop/hello.cpp

slide-24
SLIDE 24

Exploring filesystem

  • cd / changes your current directory to root (/)
  • ls lists the content of the present working directory
  • ls -a lists all files including hidden ones (those whose name

start with .)

  • tree displays a tree view of the system (if the command is not

present install it with sudo apt-get install tree)

slide-25
SLIDE 25

Hard and Soft (Symbolic) Links

  • A symbolic link is a pseudo-file which behaves as an alternative

name for some other file or directory

  • The “contents” of the symlink are the real name pointed to
  • When you try to use a file name including a symlink, the kernel

replaces the symlink component with its ‘contents’ and starts again

  • Symlinks allow you to keep a file (or directory) in one place, but

pretend it lives in another

slide-26
SLIDE 26

Hard and Soft (Symbolic) Links

  • Hard link is an alternative path to a file equally important as any
  • ther path
  • Two files that have same inode number are hard links of each
  • ther

– An inode is the data structure that describes a file on disk – It contains information about the file, including its type

(file/directory/device), modification time, permissions, etc.

– A directory entry contains a name and an inode number

  • So a file’s name is not considered to be part of the file itself
slide-27
SLIDE 27

e.g. 2to3 is a symlink to 2to3-2.7 in /usr/bin

slide-28
SLIDE 28

Creating a symlink..

slide-29
SLIDE 29

Creating a hard link...

slide-30
SLIDE 30

References

  • Linux System Administration: modules 1-6, 12 and 13
  • Linux Essentials: Chapters 3, 4 and 6