Managing Files. Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics.

Slides:



Advertisements
Similar presentations
A Guide to Unix Using Linux Fourth Edition
Advertisements

Pre-Assessment Questions
The Unix File System. What are the three parts of every file on a Unix filesystem? And where is each stored? Filename - stored in directories Inode -
Lab6 CPCS361 I.Mona Alshehri. Working with Files and Directories Creating files Create a file with the cat command type the command cat > name_of_file.
Inodes. Filesystems Each partition has a filesystem –This filesystem will usually support a directory hierarchy Every file on a disk partition is allocated.
Links Learning Objectives: 1. To understand the basics of links & its usage 2. To learn the construction / removal of different types of links 3. To distinguish.
Introduction to Unix (CA263) File System
Exploring the UNIX File System and File Security
Linux+ Guide to Linux Certification, Second Edition
Linux Linux File System.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
7/15/2015B.RamamurthyPage 1 File System B. Ramamurthy.
Copyrights© 2008 BVU Amplify DITM DATA BASE MANAGEMENT system Page:1 Lesson 2: The File System By Simi.
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.
Guide To UNIX Using Linux Fourth Edition
Filesystem Hierarchy Standard (FHS) –Standard of outlining the location of set files and directories on a Linux system –Gives Linux software developers.
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
1 THE UNIX FILE SYSTEM By Chokechai Chuensukanant ID COSC 513 Operating System.
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 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.
Files & Directories Objectives –to be able to describe and use the Unix file system model and concepts Contents –directory structure –file system concepts.
1 Lecture 2 Working with Files and Directories COP 3344 Introduction to UNIX.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
Linux+ Guide to Linux Certification, Second Edition
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2011 by the Trustees of Indiana University except as noted.
Linux overview. Architecture Kernel File system Shell: Korn, Bourne, C, Bash X Windows: Motif, Open Look, X.OrgX.Org Desktop: Gnome, KDE,etc.
Chapter Two Exploring the UNIX File System and File Security.
Chapter 11 File Sharing. Sharing Techniques Duplicate files Common login Setting appropriate access permissions on shared files Common group for team.
File Permission and Access. Module 6 File Permission and Access ♦ Introduction Linux is a multi-user system where users can assign different access permission.
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:
Chapter Two Exploring the UNIX File System and File Security.
Chapter 4: File Security & Permissions Also: Hard and Soft Links, see p77-80 &
Linux+ Guide to Linux Certification, Third Edition
Linux+ Guide to Linux Certification, Third Edition
Managing Files CSCI N321 – System and Network Administration Copyright © 2000, 2007 by the Trustees of Indiana University except as noted.
Λειτουργικά Συστήματα – Lab2 Γιάννης Πετράκης. Directory Navigation and Control  The Unix file system is set up like a tree branching out from the root.
File Systems, telnet and ftp Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
2 Manual & Filestore Mauro Jaskelioff. Introduction Using the manual The UNIX filestore File permissions.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
A gentle introduction to LINUX at the command prompt.
Files and Directories in UNIX The first file in UNIX file system is “root” or “/”
UNIX filesystem CS 2204 Class meeting 2 *Notes by Doug Bowman and other members of the CS faculty at Virginia Tech. Copyright
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.
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.
CSCI 330 UNIX and Network Programming Unit II Basic UNIX Usage: File System.
EMT 2390L Lecture 3 Dr. Reyes Reference: The Linux Command Line, W.E. Shotts.
The Unix File System R Bigelow. The UNIX File System The file system refers to the way in which UNIX implements files and directories. The UNIX file 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).
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
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
File System Interface CSSE 332 Operating Systems
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 file system "On a UNIX system, everything is a file;
Useful Linux Commands.
Exploring the UNIX File System and File Security
File System B. Ramamurthy B.Ramamurthy 11/27/2018.
The Unix File System.
Chapter Four UNIX File Processing.
Module 6 Working with Files and Directories
Lab 2: Terminal Basics.
Chapter 4: The Linux Filesystem
January 26th, 2004 Class Meeting 2
Presentation transcript:

Managing Files

Module 5 Managing Files ♦ Introduction “On a Linux system, everything is a file; if something is not a file, it is a process.” ♦ Topics ► What is a File? ► File Characteristics ► What can we do with Files?

Managing Files What is a File? ♦ A file is a container for data or link to a device. ♦ Every file has a name and may hold data that resides on a disk. ♦ A file is a name and the associated data is stored on a mass storage device. It is a stream of data bytes. ♦ The different types of files are: ► Regular files ► Can be text, data and drawings. ► Executable programs. ► Directories. ► Special files.

Managing Files root]# ls -l total rw-r--r-- 1 root root 1134 Sep 28 12:31 anaconda-ks.cfg drwxr-xr-x 3 root root 4096 Oct 3 15:29 Desktop drwx root root 4096 Oct 3 15:15 evolution -rw-r--r-- 1 root root Sep 28 12:30 install.log -rw-r--r-- 1 root root 3436 Sep 28 12:30 install.log.syslog drwxr-xr-x 3 root root 4096 Oct 1 12:48 intro-linux -rw root root Oct 1 12:42 intro-linux.html.tar drwx root root 4096 Oct 1 14:45 Mail -rw-r--r-- 1 root root 51 Oct 3 12:44 new.txt root]# File Characteristics ♦ A file has several characteristics associated with it. They can be displayed using the ls –l command as shown below: Contd…

Managing Files File Characteristics ♦ Example: -rw-r--r-- 1 root root 1134 Sep 28 12:31 anaconda-ks.cfg ♦ The explanation of output is as follows: ► File Type ► – regular file ► d directory ► l link file ► c character special file ► b block special file ► p pseudo special file ► Permissions ► No. Of links to the File Contd…

Managing Files File Characteristics ► Owner ► Group ► File Size Bytes ► Time Stamp ► File Name

Managing Files What can we do with Files? ♦ A file is a collection of data, stored on disk and that can be manipulated by listing the contents in the directory, changing the locations of files and directories, viewing files, creating and editing files, moving, copying and deleting files. ♦ The user can also create directories, change directories, delete directories and view PDF files. ♦ A directory is also a file that acts as a folder for other files. ♦ A directory can also contain other directories (subdirectories); a directory that contains another directory is called the parent directory of the directory it contains.

Managing Files ♦ Copying files Copying files and directories is done using the cp command. The cp command is used to copy the files and directories from the specified source to the specified destination. The user can copy a file into the directory, but under a different name. Syntax cp Example: # cp file1 dir1 ♦ Removing files The rm command is used to remove single files, rmdir to remove empty directories (Use ls -a to check whether a directory is empty or not). The rm command also has options for removing non-empty directories with all their subdirectories, read the Info pages for different options of rm command. Contd… Manipulating files and directories

Managing Files Manipulating files and directories ♦ Moving and Renaming files The mv command is used to move a file from its source to any location within the file structure. Example of moving a file: # mv file1 /iiht/file1 The above example says, the file file1 is moved to a different directory iiht. ► The mv command is also used to rename a file or a directory ► Example of renaming a directory: # mv iiht dir1 Contd…

Managing Files ♦ Linking files A link is nothing more than a way of matching two or more file names to the same set of file data. There are two ways to achieve this: ► Hard link ► Soft link ♦ Hard link Associates two or more file names with the same inode. Hard links share the same data blocks on the hard disk, while they continue to behave as independent files. ♦ Soft link or symbolic link (or symlink) Soft link is a small file that is a pointer to another file. A symbolic link contains the path to the target file instead of a physical location on the hard disk. Since inodes are not used in this system, soft links can span across partitions. Manipulating files and directories

Managing Files Lab Exercise ♦ Create a directory by name test and create the files file1 file2 and file3, create hardlink for file1 to new file data. ♦ Differentiate deleting hard link files and soft link files.