Linux Files. Files and directories As in Windows directories are structures which contain –Other directories –Files.

Slides:



Advertisements
Similar presentations
RH030 Linux Computing Essentials
Advertisements

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.
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition
Guide To UNIX Using Linux Third Edition
1 Basics of Linux On linux machine: Login at your home directory Open a “shell” or “terminal” or “xterm” workspace (4) On windows machine Intall linux.
Basic UNIX © McGraw Hill All rights reserved.
A Mini UNIX Tutorial. What’s UNIX?  An operating system run on many servers/workstations  Invented by AT&T Bell Labs in late 60’s  Currently there.
Linux Commands LINUX COMMANDS.
L INUX C OMMAND L INE I NTERFACE G UNAANBAN.G
Learning basic Unix command IT 325 operating system.
COMP1070/2002/lec4/H.Melikian COMP1070 Lecture #5  Files and directories in UNIX  Various types of files  File attributes  Notion of pathname  Commands.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
Help session: Unix basics Keith 9/9/2011. Login in Unix lab  User name: ug0xx Password: ece321 (initial)  The password will not be displayed on the.
The file structure and related utilities CS240 Computer Science II.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
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.
CHAPTER 1 UNIX FOR NONPROGRAMMERS By U ğ ur Halıcı.
Linux Directory Navigation. File & Directory Commands This is a minimal list of Unix commands that you must know for file management: ls (list) mkdir.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
Unix Basics Chapter 4.
File Permissions. What are the three categories of users that apply to file permissions? Owner (or user) Group All others (public, world, others)
Linux+ Guide to Linux Certification, Second Edition
The UNIX development environment CS 400/600 – Data Structures.
Chapter Two Exploring the UNIX File System and File Security.
INTRODUCTION TO LINUX Jacob Chan. GNU/Linux Consists of Linux kernel, GNU utilities, and open source and commercial applications Works like Unix –Multi-user.
1 Operating Systems and Using Linux Topics What is an Operating System? Linux Overview Frequently Used Linux Commands Reading None.
Unix/Linux cs3353. The Shell The shell is a program that acts as the interface between the user and the kernel. –The shell is fully programmable and will.
Linux file system "On a UNIX system, everything is a file; if something is not a file, it is a process." Sorts of files (on a Linux system) Directories:
BIF713 Basic Unix/Linux Commands Getting Help with Commands.
Chapter Two Exploring the UNIX File System and File Security.
Welcome to CS323 Operating System lab 1 TA: Nouf Al-Harbi NoufNaief.net.
Chapter 1 : The Linux System Part 2 Lecture 2 11/14/
Agenda Basic Unix Commands (Chapters 2 & 3) Miscellaneous Commands: whereis, which, whoami, finger, passwd, cal, date Working with Files: cat, more, less.
1May 16, 2005 Week 2 Lab Agenda Command Line FTP Commands Review More UNIX commands to learn File name expansion - * Introduction of vi.
E X C E E D I N G E X P E C T A T I O N S Basic LINUX Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Directory structure:
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
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.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
Linux Commands C151 Multi-User Operating Systems.
EGEE-III INFSO-RI Enabling Grids for E-sciencE Apr. 25, Grid Computing Hands On Training for Users Faculty of Sciences, University.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
Isecur1ty training center Presented by : Eng. Mohammad Khreesha.
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
Learning basic Unix command It 325 operating system.
File Management commands cat Cat command cat cal.txt cat command displays the contents of a file here cal.txt on screen (or standard out).
Linux Tutorial Lesson Two *Getting Help in Linux *Data movement and manipulation *Relative and Absolute path *Processes Note: see chapter 1,2,3 from Linux.
Linux Filesystem Management
UNIX Basics Matt Hayward October 18, 2016 LS560 – Information Technology for information professionals.
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Getting started with CentOS Linux
Commands Basic syntax of shell commands UNIX or shell commands have a basic structure command -options target command comes first (such as cd or ls) any.
Linux 101 Training Module Linux Basics.
Linux file system "On a UNIX system, everything is a file;
Lecture 2 Working with Files and Directories
C151 Multi-User Operating Systems
Useful Linux Commands.
CS314 – Section 5 Recitation 1
Eric Shook Department of Geography Kent State University
Exploring the UNIX File System and File Security
Getting started with CentOS Linux
UNIX/LINUX Commands Using BASH Copyright © 2017 – Curt Hill.
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
January 26th, 2004 Class Meeting 2
Presentation transcript:

Linux Files

Files and directories As in Windows directories are structures which contain –Other directories –Files

Root directory Base directory –All others are contained within this directory Not to be confuse with /root –This is the home directory of the root user

Typical directories /etcconfiguration /varfiles that change (vary) such as logs /homestructure containing user homedirectories /binexecutables /sbinroot user executables /usrregular user files /tmp /root /boot /devused to access hardware resources /libsystem libraries

Shell Command line environment –Like the Windows “DOS command line” Prompt displayed –Enter a command and bit [enter] Result (if any) returned, and next prompt displayed Or.. Error message

Commands pwd –print working directory cd –change directory mkdir rmdir ls touch

cd cd name –changes to the name directory uses relative and absolute names one dot refers to current directory two dots refers to parent directory forward slash ( / ) indicates a directory name no slash indicates a subdirectory in the current directory

ls lists the names of files in a directory ls –l –long listing

touch updates the time stamp of a file to that time creates a new file (0 bytes) if the file does not exist

cp copy cp file1 file2

rm remove rm file1 no “undelete” –file is not placed into a ‘recycle’ bin as in Windows

mv move mv file1 file2 can be used to rename a file –move it to a file with a different name

file displays the type of file file myfilename can be used to determine if the file is an executable or a “text” file which can be displayed using cat, more or less

cat views the contents of a file will scroll off the screen –use the “ | “ (pipe) to the more command cat | more displays a screen, then stops spacebar will bring up next screen enter key brings up next line ctrl-x will exit the cat command

zcat “cats” a compressed file to the screen

less displays a screen at a time –use “Q” to exit –pageUp and pageDown as well as arrow keys can navigate the file

more displays a screen at a time

Filenames Length can be 256 characters upper or lower case peridos, numbers, punctuation marks –NO SLASHES!

File Properties ls test -rwxr-xr-x 1 cmalinow users Apr 1 15:12 test permissions –user, group, other user group timestamp size

File Properties ls test -rwxr-xr-x 1 cmalinow users Apr 1 15:12 test first character indicates type -regular file ddirectory user permissionrwx group permission “other” permission

Changing owner chown username.groupname filename –chown cmalinow.faculty testfileA command is invoked by root

chmod Changes permissions assigned to the file or directory –used by root –uses “g”, “u”, or “o” for group, user and other chmod o+w test –allows “other” to write to file chmod g=rw test –allows the group to read and write

chmod read, write and execute assigned –4, 2, 1 respectively chmod 640 test –user has “6”4 and 2 (read and write) –group has “4”(read) –others have “0”no access

File permissions When creating a file, permission are assigned umask determines the permissions to assign umask 022 –same pattern as permission in chmod –umask executed as part of logging in

What’s a “sticky bit”? Dilemma –depending on permissions set, any user in the group might be able to delete a file of another group member –setting the sticky bit on a directory only allows the owner, the directory owner, or root to rename or delete the file set the sticky bit by chmod 1nnn –1 indicates to put a sticky bit on the directory chmod 1777 mydir ls –ld mydir drwxrwxrwxt2 cmalinow faculty … etc… “t” indicates the ‘sticky bit’ is on