Linux Overview.

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

Linux can be generally divided into four major components: 1. KERNEL – OS, ultimate boss The kernel is the core program that runs programs and manages.
Backups In Linux. The Linux System Many Linux distros set up seperate "/home" and "/" (root) partitions. User configuration files are hidden with a "."
5 Basic utilities When a user logs in to the Linux operating system the directory that they will start in is their home directory. Most users will have.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition Chapter 3 Linux Installation and Usage.
1 Web Server Administration Chapter 3 Installing the Server.
GNU/Linux Filesystem 1 st AUT GNU/Linux Festival Computer Engineering & IT Department Bahador Bakhshi.
Linux+ Guide to Linux Certification, Second Edition
Chapter 5 Accessing Files and Directories. How Directories Get Created OS installation: usr, dev, etc, export, kernel and others places to store installation.
The UNIX File System.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
Introduction to UNIX GPS Processing and Analysis with GAMIT/GLOBK/TRACK T. Herring, R. King. M. Floyd – MIT UNAVCO, Boulder - July 8-12, 2013 Directory.
Installing Windows XP Professional Using Attended Installation Slide 1 of 41Session 2 Ver. 1.0 CompTIA A+ Certification: A Comprehensive Approach for all.
Linux+ Guide to Linux Certification, Third Edition
CompTIA Linux+ Certification
Guide To UNIX Using Linux Fourth Edition
Introduction to Linux Installing Linux User accounts and management Linux’s file system.
LINUX FILE SYSTEMS ADMINISTRATION TOPIC 4.0. LINUX DIRECTORY STRUCTURE DIRECTORY STRUCTURE ABSOLUTE PATHNAME RELATIVE PATHNAME.
Manage Directories and Files in Linux
Lesson 7-Creating and Changing Directories. Overview Using directories to create order. Managing files in directories. Using pathnames to manage files.
Chapter 9 Part II Linux Command Line Access to Linux Authenticated login using a Linux account is required to access a Linux system. The Linux prompt will.
Ch 21 Command Syntax Using the DIR Command with Parameters and Wildcards.
Guide to Linux Installation and Administration, 2e1 Chapter 8 Basic Administration Tasks.
Unix Basics Chapter 4.
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
An Introduction to UNIX System --- Cosc513 Presentation n Instructor: Morteza Anvari n Author: Yonghong Pan n ID#: n Date: Jan.29, 2001.
Computing and the Web Operating Systems. Overview n What is an Operating System n Booting the Computer n User Interfaces n Files and File Management n.
Ch 41 Program Files, Data Files, and Subdirectories.
Chapter Two Exploring the UNIX File System and File Security.
Guide to Linux Installation and Administration, 2e1 Chapter 7 The Role of the System Administrator.
Lesson 9-Setting and Using Permissions. Overview Describing file permissions. Using execute permissions with a file. Changing file permissions using mnemonics.
Guide to Linux Installation and Administration1 Chapter 4 Running a Linux System.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Some content in this lecture added.
Operating Systems and Using Linux CMSC 104, Lecture 3 John Y. Park 1.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
UNIX (Linux) Introduction Module-1. OS Kernel In computing, the kernel is the central component of OS. It is a bridge between applications and the actual.
Chapter Two Exploring the UNIX File System and File Security.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Review Please hand in any homework and practicals Vim Scripting Inter-device communication.
Manage Directories and Files in Linux Part 2. 2 Identify File Types in the Linux System The file types in Linux referred to as normal files and directories.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 2a – A Unix Command Sampler (Courtesy of David Notkin, CSE 303)
Linux Commands C151 Multi-User Operating Systems.
Slide: 1 UNIX FILE SYSTEM By:Qing Yang ID: Operating System Research Topic December, 2000.
CS 245 – Part 1 Using Operating Systems and Networks for Programmers Jiang Guo Dept. of Computer Science California State University Los Angeles.
Agenda The Linux File System (chapter 4 in text)
Module 1 - Introduction to Linux. Users must log-in Linux is case sensitive File and Directories naming conventions (No spaces!) Files and Directories.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
Linux+ Guide to Linux Certification, Second Edition Chapter 4 Exploring Linux Filesystems.
Lecture 02 File and File system. Topics Describe the layout of a Linux file system Display and set paths Describe the most important files, including.
The Kernel At a high level, the kernel in an operating system serves as the bridge between applications and the actual data processing of the hardware.
1 CS3695 – Network Vulnerability Assessment & Risk Mitigation – Introduction to Unix & Linux.
Agenda The Bourne Shell – Part I Redirection ( >, >>,
Operating Systems and Using Linux Courtesy of John Y. Park 1.
ORAFACT The Linux File System. ORAFACT Filesystem Support Support for dozens of filesystem types including: Minix, ext2, MS-DOS, UMSDOS, VFAT, NTFS, NFS,
2Operating Systems  Program that runs on a computer  Manages hardware resources  Allows for execution of programs  Acts as an intermediary between.
Linux Administration – Finding You Way on the Command Line The Linux File Directory or Tree.
Chapter 11 Command-Line Master Class
UBUNTU INSTALLATION
C151 Multi-User Operating Systems
Linux 202 Training Module Program and Process.
The Linux Operating System
9 Linux on the Desktop.
Command Syntax Chapter 2 Using the DIR Command with
An Introduction to UNIX System --- Cosc513 Presentation
Exploring the UNIX File System and File Security
Introduction Paul Flynn
Presentation transcript:

Linux Overview

Outline Linux file system (FS) Linux vs. Windows Useful commands for manipulating the FS Linux vs. Windows What did you learn from Assignment #1 sudo Apt-get Pipes Command prompt

Linux Filesystem Everything is a File

Linux Filesystem Filesystem is a method for storing and organizing computer files and the data they contain to make it easy to find and access. Different operating systems normally use different file systems.

Linux Filesystem The filesystem in Linux stores the kernel the executable commands supported by the OS configuration information user data and special files that are used to give controlled access to system hardware and OS functions.

Linux Filesystem Items stored in the filesystem are of four types: Ordinary files contain text, data, or program information. Files can not contain other files or directories. Directories containers that hold files, and other directories. Devices are used in the same way as ordinary files providing applications with easy access to the hardware devices. Links which is a pointer to another file

Linux Filesystem The system is laid out as a hierarchical tree structure. The top-level directory is the 'root' designated by a slash '/'. Each directory can have many child directories, but only one parent directory.

Linux Filesystem

Linux Filesystem The path to a certain location can be specified as: Absolute path from root e.g. /root/home/will Relative path Accessing play from user “zeb” ../will/play

Root Common Subdirectories

Common Subdirectories Directory Stands for Content / root Top-level directory in the hierarchical tree /bin Binaries Contains binaries used by both the system administrator and non-privileged user e.g. command ‘ls’ is stored here /dev Devices Contains hardware devices directories. It is a virtual directory /etc Et cetra Contains configuration files for running applications /home Contains user subdirectories /lib Libraries Contains shared libraries e.g. C, Perl, Python general libraries /mnt Mount /proc Processes Contains information about the system e.g. process that are running. It is a virtual directory /root Default home directory for the system administrator. Isolated to increase security

Common Subdirectories Directory Stands for Content /sbin Secure Binaries Contains secured binaries that are only accessed by privileged users e.g. fdisk, partitioning tool is kept here /tmp Temporaries Contains temporary files /usr Unix System Resources Contains subdirectories such as /usr/doc which contains system documentations, /usr/local the local hosts directory /var Variables Contains log and spool files /boot Contains Linux kernel

Useful Commands

CD $ cd path changes your current working directory to path (which can be an absolute or a relative path). One of the most common relative paths to use is '..' (i.e. the parent directory of the current directory). $ cd  resets your current working directory to your home directory (useful if you get lost). $ cd -  If you change into a directory and you subsequently want to return to your original directory, use

pwd pwd - Displays the current directory ("working directory"). pwd displays the full absolute path to your current location in the filesystem. $ pwd      /usr/bin implies that /usr/bin is the current working directory.

Filesystem Comparison Linux vs. Window

Filesystem Comparison Linux Filesystem Windows Filesystem Hierarchal Structure Only a single hierarchal directory structure. Everything starts from the root directory and then expanded to subdirectories. It also has various partitions, but under the root directory. They are ‘mounted’ under specific directories (Unified scheme) Various partitions, with directories under those partitions (Volume based file hierarchy) Detection Partition will not be detected unless it has been mounted. All partitioned detected and booted, then each assigned a drive letter. Crossover Can read/write FAT16 , FAT32 Can not unless with third party support Hidden Files Implement with a name that starts with a dot. Tracks it as a file attribute Types ext2, ext3 FAT12, FAT16, FAT32, and or NTFS

Filesystem Comparison Linux Filesystem Windows Filesystem Case Sensitivity Case sensitive. File.txt is not the same as file.txt Not case sensitive Confirmation Messages Non existent e.g. when deleting, user will not be promoted whether to continue with the operation or not User will be prompted with each action Search Path Does not look into the current directories. It looks at the PATH environment variable. To run program in current directory: ./ program Checks current directory first then looks at the PATH environment variable Slashes Uses a forward slash “/” Uses a backward slash “\” Switch Indication Switches are preceded by “-” Switches are preceded by “\”

Default Directory The default working directory is your user home directory. /home/ubuntu /home is equivalent to My documents User name

Running Privileged Commands How to run privileged commands as a normal user? Use sudo command Sudo is a program which can be used by normal users to execute as super users or any other users.

Running Privileged Commands Example Running the following statement sudo –l Then entering password will produce a listing of command that the user may execute as well as how and as who they maybe executed.

Beware of the dark side of root root user privileges are only needed for very specific tasks with security risks: mounting, creating device files, loading drivers, starting networking, changing file ownership, package upgrades... Even if you have the root password, your regular account should be sufficient for 99.9 % of your tasks (unless you are a system administrator). In assignments, it is acceptable to use root. In real life, you may not even have access to this account, or put your systems and data at risk if you do.

Using the root account In case you really want to use root... If you have the root password: su - (switch user) In modern distributions, the sudo command gives you access to some root privileges with your own user password. Example: sudo mount /dev/hda4 /home

Live process activity top - Displays most important processes, sorted by cpu percentage top - 15:44:33 up 1:11, 5 users, load average: 0.98, 0.61, 0.59 Tasks: 81 total, 5 running, 76 sleeping, 0 stopped, 0 zombie Cpu(s): 92.7% us, 5.3% sy, 0.0% ni, 0.0% id, 1.7% wa, 0.3% hi, 0.0% si Mem: 515344k total, 512384k used, 2960k free, 20464k buffers Swap: 1044184k total, 0k used, 1044184k free, 277660k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 3809 jdoe 25 0 6256 3932 1312 R 93.8 0.8 0:21.49 bunzip2 2769 root 16 0 157m 80m 90m R 2.7 16.0 5:21.01 X 3006 jdoe 15 0 30928 15m 27m S 0.3 3.0 0:22.40 kdeinit 3008 jdoe 16 0 5624 892 4468 S 0.3 0.2 0:06.59 autorun 3034 jdoe 15 0 26764 12m 24m S 0.3 2.5 0:12.68 kscd 3810 jdoe 16 0 2892 916 1620 R 0.3 0.2 0:00.06 top You can change the sorting order by typing M: Memory usage, P: %CPU, T: Time. You can kill a task by typing k and the process id.

Updating and installing packages Debian-based distros use a software installer called apt-get, which uses the Debian dpkg system to retrieve, unpack, and install software. Apt-get is the command you use to get that software. Synaptic is the GUI for apt-get

Pipes Unix pipes are very useful to redirect the standard output of a command to the standard input of another one. Examples cat *.log | grep -i error | sort grep -ri error . | grep -v “ignored” | sort -u \ > serious_errors.log This one of the most powerful features in Unix shells!

Command prompt User_name@device_name:~$ ubuntu@ubuntu:~$ Use UP arrow key to invoke previous commands Use TAB to auto-complete commands

Conclusion You need to know the difference between relative and absolute path when dealing with Linux directories You need to know how Linux FS is different from Windows FS You need to know when to switch to super user privileges

References The basic similarities between Linux and DOS http://www.control-escape.com/linux/lx-basics.html Introduction to Unix http://wwwhomes.doc.ic.ac.uk/~wjk/UnixIntro/ Windows-to-Linux Roadmap http://www.ibm.com/developerworks/linux/library/l-roadmap1.html