Friday 12 October 2012

Linux O.S. ( 12 Oct. 2012 )



Short test was taken by sir total marks 15
Searching in Linux
 find  /home –name newfile
Home refers where to find and name refers what to find
 find /home –name newfolder –type f
-type f specifies that search only folders
 find /home –name as* -type –d
 It will find all folders starting with as  -d specifies only folders
If you are confirmed that target is file/folder than specify type other wise don’t mention type switch
 find / -name win32.vir –ok rm “{ }” \;
Rm used for remove directory
“{ }” used for creating buffer or temporary storage
 find / -name win 32.vir –ok rm –rf “{ }” \;
            ok specify that user’s action needs verification
 find / -name win 32.vir exit rm –rf “{ }” \;
            due to exit switch it will not ask for verification
 find / -name abc –type f –exec –cp –rf “{ }” /home \;
            it will copy selected files (executable files) to /home directory

Links management
There are two types of links
-          hard link
-          symbolic link
i-node number:
a numeric value that is assigned to an folder and file is called i-node number
to view i-node number                                               ls -il
to create link of file1                                      ln file1 file 2
                in above command file1 is existing file and file2 is link file
Advantages :
·         if you update one file other will update
·         a backup will be available
·         if you delete actual file link will be available
Disadvantages:
o   Create only files not folders
o   Only can create link within a partition can’t create in another partition

Symbolic links

 ln s folder1 folder2
folder1 is existing folder and folder 2 is link folder

Advantages :
·         Create files and folders
·         User can create link within a partition and within another partition
Disadvantages:
o   No backup is available
o   Works like a shortcut (if original/source folder is deleted link will not work)

Syllabus for mid term
1-      What is mount point
2-      How to mount a storage device
3-      Basic commands (All slides)
4-      User management (only create/add a user through both method)
5-      Links management
//fb like box