Unit 4
Files and Directories
A collection of data
Ordinary:
Directory:
Special Files:
name i-node # type mode links user group date size loc
Data
$ vi myfile
test doc c
.profile mon_report
manuals trio_ltr reports c pgms
test1 walrus
suba
/home/team01/doc/mon_report
/usr/bin/ls
The print working directory command can be used to find out what
your current directory is:
$ pwd
/home/team01
Syntax : ls [ directory ]
To list the contents of your current directory:
$ ls
c doc manuals test1
./c:
./doc:
mon_report trio_ltr walrus
$ ls -l
total 5
drwxrwxr-x 2 team01 staff 1024 Aug 12 10:16 c
drwxrwxr-x 2 team01 staff 512 Feb 18 09:55 doc
-rwxrwxr-x 1 team01 staff 320 Feb 22 07:30 suba
-rwxrwxr-x 2 team01 staff 144 Feb 22 16:30 test1
$ ls -li test1
29 -rwxrwxr-x 2 team01 staff 144 Feb 22 16:30 test1
$ cd
$ cd ..
4. How can you list all files in a directory, including hidden files ?
../team03/dir1 :
/tmp/file1 :
/.profile :
./.profile :
7. Write down the three different file types that AIX knows:
a)
b)
c)
(or)
$ cd /home/team01
$ mkdir test relative path name
$ rmdir /home/team01/test
$ rmdir doc
$ mkdir -p dir1/dir2/dir3
/
home
/
team01
home dir1
dir2
team01
dir3
$ rmdir -p dir1/dir2/dir3
$ ls -ldi mydir
51 drwxr-xr-x 2 team01 staff 512 Jan 17 17:38 mydir
$ istat mydir
Inode 51 on device 10/8 Directory
Protection: rwxr-xr-x
Owner: 208(team01) Group: 1 (staff)
Link count: 2 Length 512 bytes
$ ls -l
-rwxrwxr-x 1 team01 staff 320 Jan 6 07:30 suba
$ date
Tues Sep 10 12:25:00 2002
$ ls -l
-rwxrwxr-x 1 team01 staff 320 Sep 10 12:25 suba
-rw-r--r-- 1 team01 staff 0 Sep 10 12:25 new_file
Exercise