Meaning of extension
compute.c
compute.o
compute
memo.0410.txt
A text file
memo.pdf
memo.ps
memo.Z
memo.tgz or memo.tar.gz
memo.gz
memo.bz2
memo.html
Other partitions:
/usr (for utilities), /home, /var
Using Inodes
Information nodes, or inodes
Each directory/file has an inode and is identified by
an inode number
Inode 0 contains the root of the directory structure (/)
Jumping-off point for all other inodes
fstab
group
inittab
login.defs
motd
passwd
printcap and termcap
profile, bashrc and rc
Accounting programs
Manufacturing programs
Programs for research applications
Office software
Example:
mount -t iso9660 /dev/cdrom /media/cdrom
Using Wildcards
Wildcard: special character that can stand for any
other character or a group of characters
* represents any group of characters in a file name
Example: ls *.txt
instructions.txt minutes.txt
Three-digit format:
read:
4
write:
2
execute:
1
Total could be 0 to 7 for each of UGO permissions
chmod 711 data
chmod u+rwx data
chmod g+x-rw data
chmod o+x-rw data
$ who am I
jenny pts/7 Aug 21 10:02
$ ls -ld /home/alex/info
drwx-----x 2 alex pubs 512 Aug 21 09:31 /home/alex/info
$ ls -l /home/alex/info
ls: /home/alex/info: Permission denied
$ ls -l /home/alex/info/financial /home/alex/info/notes
-rw------- 1 alex pubs 34 Aug 21 09:31 /home/alex/info/financial
-rw-r--r-- 1 alex pubs 30 Aug 21 09:32 /home/alex/info/notes
$ cat /home/alex/info/notes
This is the file named notes.
$ cat /home/alex/info/financial
cat: /home/alex/info/financial: Permission denied
Alex can give others read access to his info directory:
$ chmod o+r /home/alex/info
$ ls -l program1
-rwxr-xr-x 1 alex pubs 15828 Nov 5 06:28 program1
$ chmod u+s program1
$ ls -l program1
-rwsr-xr-x 1 alex pubs 15828 Nov 5 06:28 program1
$ chmod g+s program1
$ ls -l program1
-rwsr-sr-x 1 alex pubs 15828 Nov 5 06:28 program1
setfacl
setfacl uses a single set of permissions or a single
octal number to represent the permissions being
granted to the user or group represented by ugo and
name
The setfacl -modify (or m) option adds or modifies
one or more rules in a file's ACL using the following
format:
setfacl --modify ugo:name:permissions file-list
-name: name of the user or group that permissions are
being set for; omitted when specify permissions for
other users (o)
-permissions: permissions in either symbolic (rwx ) or
absolute format (octal number)
oracle
oracle
oracle
oracle
oinstall
oinstall
oinstall
oinstall
4096
4096
1570
8072
2008-01-30
2008-01-29
2008-01-30
2008-01-30
15:06
15:29
13:22
15:06
.
..
file1
file2
getfacl
the getfacl utility displays a file's ACL
$ getfacl report
# file: report
# owner: max
# group: max
user::rwuser:sam:rwgroup::r-mask::r-other::r- The -omit-header (or just -omit) option causes getfacl
not to display the header
Summary
In UNIX/Linux, a file is the basic component for data
storage
A file system is the UNIX/Linux systems way of
organizing files on storage devices
The standard tree structure starts with the root (/) file
system directory
The section of the disk that holds a file system is
called a partition
A path, as defined in UNIX/Linux, serves as a map to
access any file on the system
Summary (continued)
You can customize your command prompt to display
useful information
The ls command displays the names of files and
directories contained in a directory
Wildcard characters can be used in a command and
take the place of other characters in a file name
Use mkdir to create a new directory
Use cp to copy a source file to a destination file
Use chmod to set permissions for files that you own
Command Summary