Download presentation
1
Getting Started with Linux
Session #1
2
UNIX History
3
UNIX Concepts UNIX Structure Some Basic Commands UNIX File System
Files: permissions, properties, manipulation Principal Linux Files
4
Topics
5
Some Basic Commands who, who am i date echo
6
UNIX Files and File System
7
UNIX File Tree
8
Debian Directory Tree
9
User File Tree
10
File System Usage Directories: examples Absolute and relative paths
Where I am? - pwd Moving around: cd command () Creating and removing: mkdir, rmdir, rm -r examples
11
File System Layout
12
The ext2 superblock Magic Number Revision Level
This allows the mounting software to check that this is indeed the Superblock for an EXT2 file system. For the current version of EXT2 this is 0xEF53. Revision Level The major and minor revision levels allow the mounting code to determine whether or not this file system supports features that are only available in particular revisions of the file system. There are also feature compatibility fields which help the mounting code to determine which new features can safely be used on this file system, Mount Count and Maximum Mount Count Together these allow the system to determine if the file system should be fully checked. The mount count is incremented each time the file system is mounted and when it equals the maximum mount count the warning message ``maximal mount count reached, running e2fsck is recommended'' is displayed, Block Group Number The Block Group number that holds this copy of the Superblock, Block Size The size of the block for this file system in bytes, for example 1024 bytes, Blocks per Group The number of blocks in a group. Like the block size this is fixed when the file system is created, Free Blocks The number of free blocks in the file system, Free Inodes The number of free Inodes in the file system, First Inode This is the inode number of the first inode in the file system. The first inode in an EXT2 root file system would be the directory entry for the '/' directory.
13
Directory inode The inode for this directory entry. This is an index into the array of inodes held in the Inode Table of the Block Group name length The length of this directory entry in bytes, name The name of this directory entry.
14
Attributes and Manipulation
Files Attributes and Manipulation
15
Simple file commands Simple File Commands List the files and directories in the working (current) directory ls Display the contents of the file File1 concatenated with the contents of the file File2 cat File1 File2 Change the name of (move) file File1 to File3 mv File1 File3 Make a copy of File1 and call it File3 cp File1 File3 Erase (remove) the file File4 rm File4 Display the contents of File1 a page at a time, q to stop displaying less File1 Print the contents of File1 on the default printer lpr File1
16
File Types Everything is a file! Removed by Created by Symbol Type rm
cp, editors, etc. - regular rmdir, rm -r mkdir d Directory mknod b block device file c Character device file p Named pipe ln -s l Symbolic link socket s Unix Domain Socket
17
File Permissions x w r d Other Group Owner Execute Write Read
Execute Write Read Directory Examples: drwxr-xr-x A folder which has read, write and execute permissions for the owner, but only read and execute permissions for the group and for other users. -rw-rw-rw- A file that can be read and written by anyone, but not executed at all. -rw-r--r-- A file that can be read and written by the user, but only read by the group and everyone else
18
Numerical File Permissions Notation
Execute (X) Write )W( Read (R) Number No Yes 1 2 3 4 5 6 7 Examples: 777 is the same as rwxrwxrwx 755 is the same as rwxr-xr-x 666 is the same as rw-rw-rw- 744 is the same as rwxr--r--
19
Displaying File Information
20
I-node
21
directory examples cd /usr/local/bin cd .. pwd
cd (go to home directory) mkdir //tmp/mydir rmdir /tmp/mydir mkdir /tmp/mydir; cd /tmp/mydir; mkdir one_more_dir rmdir one_more_dir What happens? rm –r one_more_dir
22
Principal Linux Files Description File Linux kernel /boot/vmlinuz*
Filesystems mounted or available for mounting /etc/fstab Map of IP numbers to hostnames /etc/hosts Hosts allowed to access Internet services /etc/hosts.allow Hosts forbidden to access Internet services /etc/hosts.deny Configuration for the inetd daemon, which controls access to Internet services /etc/inetd.conf Configuration for the init daemon, which controls executing processes /etc/inittab Linux kernel and distribution version /etc/issue User account information /etc/passwd Secure user account information /etc/shadow Grub loader configuration file /boot/grub/menu.lst Default environment for users of BASH shell /etc/profile Scripts for system and process startup and shutdown /etc/rc*.d Scripts for system boot /etc/rc.boot System log /var/log/messages
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.