Professional Documents
Culture Documents
Unit 4 Files and Directories
Unit 4 Files and Directories
– A collection of data
Directory:
Special Files:
name i-node # type mode links user group date size loc
Data
$ vi myfile
/ (root) /tmp
/usr /opt
/var /home
/proc
tty1
bin lp0
test doc c
.profile mon_report
manuals trio_ltr reports c pgms
test1 walrus
suba
© Copyright IBM Corporation 2008
Path Names
A sequence of names, separated by slashes (/), that describes the
path the system must follow to locate a file in the file system.
The print working directory command can be used to find out what
your current directory is:
$$ pwd
pwd
/home/team01
/home/team01
$$ ls
ls
cc doc
doc manuals
manuals test1
test1
$$ ls
ls –a
–a
.. ..
.. .profile cc doc
.profile doc manuals
manuals test1
test1
$$ ls
ls –R
–R
cc doc
doc manuals
manuals test1
test1
./c:
./c:
./doc:
./doc:
Mon_report
Mon_report trio_ltr
trio_ltr walrus
walrus
$$ ls
ls –li
–li test1
test1
29
29 -rwxrwxr-x 22 team01
-rwxrwxr-x team01 staff
staff 144
144 Feb
Feb 22
22 16:30
16:30 test1
test1
$$ cd
cd doc
doc relative
relative path
path
$$ cd
cd /home/team01/doc
/home/team01/doc full
full path
path
4. How can you list all files in a directory, including hidden files?
7. Write down the three different file types that AIX knows:
1.
2.
3.
$$ mkdir
mkdir /home/team01/test
/home/team01/test full
full path
path name
name
(or)
$$ cd
cd /home/team01
/home/team01
$$ mkdir
mkdir test
test relative
relative path
path name
name
$$ rmdir
rmdir /home/team01/test
/home/team01/test
$$ rmdir
rmdir doc
doc
rmdir:
rmdir: Directory
Directory doc
doc is
is not
not empty.
empty.
home
/
team01
home dir1
dir2
team01
dir3
$$ istat
istat mydir
mydir
Inode
Inode 51
51 on
on device
device 10/8
10/8 Directory
Directory
Protection: rwxr-xr-x
Protection: rwxr-xr-x
Owner:
Owner: 208(team01)
208(team01) Group:
Group: 11 (staff)
(staff)
Link count:
Link count: 2 2 Length 512 bytes
Length 512 bytes
Last
Last updated:
updated: Thu
Thu Jan
Jan 17
17 21:05:43
21:05:43 2002
2002
Last modified:
Last modified: Thu
Thu Jan 17
Jan 17 17:38:52 2002
17:38:52 2002
Last
Last accessed:
accessed: Fri
Fri Jan
Jan 18
18 13:30:00
13:30:00 2002
2002
$$
$$ ls
ls -l
-l
-rwxrwxr-x
-rwxrwxr-x 11 team01team01 staff
staff 320
320 Jan
Jan 66 07:30
07:30 suba
suba
$$ date
date
Tues
Tues Sep
Sep 10
10 12:25:00
12:25:00 2002
2002
$$ touch
touch suba new_file
suba new_file
$$ ls
ls -l
-l
-rwxrwxr-x
-rwxrwxr-x 11 team01team01 staff
staff 320
320 Sep
Sep 10
10 12:25
12:25 suba
suba
-rw-r--r--
-rw-r--r-- 11 team01 staff
team01 staff 00 Sep
Sep 10 12:25 new_file
10 12:25 new_file