0% found this document useful (0 votes)
13 views

Lab07.Filesystem Management

This document provides an overview of Linux filesystem management. It discusses mounting and unmounting filesystems, managing hard and soft links, file ownership and permissions, changing attributes and permissions, and locating files. The filesystem hierarchy standard and common commands for managing and searching files are also summarized.

Uploaded by

Iulian Calin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Lab07.Filesystem Management

This document provides an overview of Linux filesystem management. It discusses mounting and unmounting filesystems, managing hard and soft links, file ownership and permissions, changing attributes and permissions, and locating files. The filesystem hierarchy standard and common commands for managing and searching files are also summarized.

Uploaded by

Iulian Calin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Linux 101

Filesystem Management

Filesystem Basics
mount <device> <mountpoint>
umount

mounting

bin

dev

var

home
dir1

hard
link

dir3

dir2

Partition

Partition

super
block

index nodes, i-nodes

data blocks

dir4

Managing Links
LINK
Different identity for the same file
Hard link

Soft link (symbolic)

ln [options] target [link]


-s, --symbolic
-f, --force
-I, --interactive
Advantages
make data available in multiple places without duplication
give multiple names to the same command

Hard links cannot be created between filesystems

File Ownership
Linux file security is build upon:
file ownership
file permissions

ownership
(two tiered)

owner
group

owner
permissions group
(three tiered) others

Files can be owned by non-login accounts


User and Group are represented internally by numbers
can only be run by root

chown [options] [newowner][:newgroup] filename


chgrp [options] newgroup filename

File Permissions
group permissions

- r w x r x r - x
file type code

r
w
x

read
write
execute

SUID
SGID
Sticky bit

owner permissions

4
2
1
s in owner execute bit
s in group execute bit
t in world execute bit

others (world) permissions

Symlinks always have 777


permissions.
Changing the permissions on a
symlink affects the targeted file.

Changing Permissions
chmod [options] [mode[,mode]] filename
octal number

NNNN

mode
symbolic form = <permission-set> <op> <perms>
r
+
u
w
g
x
=
o
X
a
s
Permissions can only be adjusted by owner and root.
t
Set Default Mode:
u
umask <mask>
g
Mask is subtracted from 0666 for files and
o
0777 for directories.

File Attributes
chattr

Attributes:
a i s t A j -

+ attr
=

file

append only
immutable
secure deletion
no tail merge
no access time updates
journal (not on ext2)

Locating Files
Filesystem Hierarchy Standard (FHS)

static

shareable
/usr
/opt

unshareable
/etc
/boot

variable

/home
/var/mail

/var/run
/var/lock

find [path] [expression]


locate <search_string>
whereis
which

Searches for binary, configuration and


documentation of a program
Searches environment path for the first occurrence
of the program

You might also like