3D Geometry 2018
3D Geometry 2018
Asst. Prof
Dept of CSE, SJEC
In this chapter
Initial categorization of files
Features of unix filename
Hierarchical structure containing files and directories
Parent child relationship
Significance of home directory and HOME variable
cd and pwd command
mkdir and rmdir
Absolute and relative pathnames
Using ls command
Class Objective
Understand the meaning of a file and its categories
Valid filename
Parent-Child Relationship
The HOME Variable
Pwd
Cd
mkdir/rmdir
Absolute Pathnames
The File
File is a container for storing information
Unix file doesn’t have eof(enf of file) mark
All file attributes are kept in a separate area of the hard
disk, accessible by the kernel
Naming File
Binary File
Contains both printable and unprintable characters
that cover the ASCII range(0 to 255)
Eg: Unix commands and object codes
Directory File
Every directory consists of filename and a unique
number-inode number
Device Files
Device files are found under /dev directory
All devices and peripherals are represented by files.
Eg: device drivers
Class Objective
Parent child relationship
Significance of home directory and HOME variable
cd and pwd command
mkdir and rmdir
Absolute and relative pathnames
Parent Child Relationship-The Unix
File System Tree
The Home and PWD command
$ echo $ HOME
/home/staff
Syntax:$ls –axF
Other ls options
Listing Directory Contents:
Syntax: $ ls –x directoryname1,directory name2……
$ ls –x helpdir progs
Other ls options
Recursive Listing(-R)
The –R(recursive) option lists all files and
subdirectories in a directory tree.
$ ls –Rx
Chapter 5
Handling Ordinary Files
Topics in this chapter
View text files with cat and more command
Cat to create file
Copy,remove and rename commands.
Count the number of lines , words and characters
Display ASCII octal value of text with od
The display.txt and display1.txt file
originally contains the following information
Output of display.txt
Output of display1.txt
Cat command can be used for the
following purposes
used to Displaying contents of files
$ cat display.txt
Syntax: $ cat -v
$ cat options
2. Numbering Lines(-n): cat –n numbers lines in a
program.
Helps the programmer while debugging
Copy Command
Used to copy files or group of files
Creates a exact duplicate copy with a different file
name
Requires minimum 2 file names.
Predict the output: Assume the
PWD to be USP
$ cp display.txt play.txt
Copy display.txt to play.txt
$ cp display.txt display.txt
error
The $rm command: Remove files
Uses
Used to delete a single file
Used to delete multiple files
Used to delete files and subdirectories
mv command
2 distinct features
It renames a file (directory)
Eg: mv display.txt screen.txt
Eg more display.txt
----more—(17%)
which means 17% of the document “display.txt” is
shown on screen.
Navigation
f or spacebar to move forward
b to move backward
Repeat factor:
10f //10 pages move ahead
10b //10 pages move backwards
2f // 2 pages move forward