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 – Learning some HowTos's of GNOME and Ubuntu 14.04 – Learning basic Linux shell commands and concepts
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)
GNOME desktop on older Ubuntu, may be 10.04
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...
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
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.
Installing and Updating Software ● A package in a Linux distribution provides one piece of the system, such as the Linux kernel , the C compiler, the shared software code for interacting with USB devices, or the Firefox web browser ● Packages are often dependent on other packages...
Debian Package Management ● dpkg - can install, remove, and build packages but can not automatically download and satisfy all dependencies. ● apt ( A dvanced P ackage T ool) – a higher level package management system... generally tools are build upon it like apt-get , aptitude , synaptic , Ubuntu Software Center , Update Manager
Red Hat Packet Manager
openSUSE’s YaST Software Management
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.
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
The X Window System ● 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 )
Virtual Terminals ● VT s are console sessions that use the entire display and keyboard outside 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
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
Turning off GUI :) ● sudo service gdm stop – most GNOME desktops ● sudo service lightdm stop – Ubuntu ● sudo telinit 3 – RPM-based, like openSUSE or CentOS
basic operations in the shell terminal
Rebooting and Shutting Down ● halt , poweroff shutdown -h ● reboot shutdown -r ● shutdown -h 10:00 "shutting down for scheduled maintenance"
Locating Applications
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
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
Exploring filesystem ● cd / c hanges your current d irectory to root (/) ● ls l i s ts the content of the present working directory ● ls -a l i s ts 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 )
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
Hard and Soft (Symbolic) Links ● Hard link is an alternative path to a file equally important as any other path ● Two files that have same inode number are hard links of each other – 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 ●
e.g. 2to3 is a symlink to 2to3-2.7 in /usr/bin
Creating a symlink..
Creating a hard link...
References ● Linux System Administration: modules 1-6, 12 and 13 ● Linux Essentials: Chapters 3, 4 and 6
Recommend
More recommend