Updated: 2013-05-08 21:01 EDT
Review last week. Did you do everything assigned last week?
Do your Fedora 12 install using Lab Worksheet #07 PDF
Assignment #08 HTML has a New Due Date of March 22 11am
set -o physical
IndexWithout permission to use .
or ..
inside a directory, most commands using these names all fail:
$ cd /tmp ; mkdir dir ; cd dir ; pwd
/tmp/dir
$ chmod u-x . ; ls
ls: cannot open directory .: Permission denied
$ cd .
-bash: cd: .: Permission denied
$ ls ..
ls: cannot access ..: Permission denied
So why does this subsequent command succeed (in BASH)?
$ cd ..
$ pwd
/tmp
The answer is here in the physical
option being disabled:
$ set -o | grep 'physical'
physical off
The shell is secretly internally using the ..
to change the current directory from /tmp/dir
to just /tmp
and is using that to do cd /tmp
instead of doing the cd ..
that you typed! The shell isn’t actually using and following the ..
pathname! See the updated section on set -o physical
in Login and Shell Startup Files, aliases, options: .bash_profile and .bashrc. System administrators should always set the -o physical
option in BASH.
ls -l
IndexThere are three sets of of three read/write/execute permissions set in every inode: one set for the inode’s user/owner, one set for the group, and a third set for all other users.
When performing a long directory listing, ls -ld
, the inode’s permissions (mode) appear as nine characters (three sets of read/write/execute) in the first field (column) of each output line, after the inode’s type indicator character. The second field in the output is a link count. The third field is the user/owner of the inode. The fourth field is the group to which the inode belongs. The fifth field is the date/time the inode was modified. The last field is a name for the inode. (Inodes may have multiple names.) If you use the -i
option, the inode numbers appear at the start (left) of the output lines:
$ ls -il
555 -rw-r----- 3 user1 group1 123 Nov 12 14:14 fileone
928 drwxrwxr-x 2 user1 group1 4096 Nov 12 14:14 directoryone
382 lrwxrwxrwx 1 root root 30 Oct 13 12:39 symlink -> ../some/place
fileone
owned by user1
and in group group1
with size 123 and link count of 3.directoryone
symlink
The permissions and owners of symbolic links are ignored; all that matters are the permissions on the inode being linked to. Symbolic links allow directories to appear to have multiple names.
The “inode type” character is the first character before the nine permission characters. It identifies the type of the inode that this name is attached to. The three most common inode types are:
-
(a hyphen/minus/dash) for a regular file inoded
for a directory inodel
(lower-case L) for a soft or symbolic link (soft link) linking to a pathname (not to an inode!)In the example above,
fileone
is typed as a regular file (the type character is a leading -
)directoryone
is a directory (a leading ‘d’)symlink
is a symbolic link (a leading ‘l’) that points to pathname ../some/place
The permissions, owner, and group of symbolic links are ignored; all that matters are the permissions on the inode being linked to.
Your in-class notes go here.
33%
Keep a notebook with a List of Commands in it.