Listing of Folders (ls): -
Q) Which command will list the files and sub – directories
present inside a directory ?
Ans - $ ls<Enter – Key>
Q) How we list the hidden files with other files and sub –
directories present inside a directory ?
Ans - $ ls –a<Enter – Key>
Q) How we long list i.e. the detail information about a file
or sub – directories present
inside a directory ?
Ans - $ ls -l<Enter – Key>
Q) How many columns are present for a file or sub –
directories present inside a directory
during long listing of the directories ?
Ans – There are 9 columns information present for a file or
sub – directory of a directory
during its long listing.
Such as –
1. File Type and Permission –> This column gives which
file type is it and its corresponding permission given to owner, group and
other.
2. No of links –> This column gives number of links
connected to the corresponding
file or sub - directory.
3. User Login Name I.e. User ID –> Give Login ID of Owner
4. Group ID –> Give the group id in which Owner of the
file belongs
5. File or Sub – directory Size –>Give size of file or
sub – directory in block or bytes. 1 Block = 512 bytes
6. Modification Month –> In which month the file is
modified last time
7. Modification Date –> In which date the file is
modified last time
8. Last Modification Time –> In which time the file is
modified last time
9. File or Sub – directory Name -> Corresponding file or
sub – directory name
Q) What are different types of file present in Unix ?
Ans – Below are different types of file present in Unix.
1. Ordinary File (-)
2. Directory File (d)
3. Character Device File (c)
4. Block Device File (b)
5. Local Socket File (s)
6. Named Pipe (p)
7. Symbolic Link (l)
Q) How you know which file is related which file type ?
Ans - $ file <File Name><Enter – Key>
Q) Give details explanation about file type and file
permission column present as 1st column during
long listing of a directory ?
Ans – File Type and File Permission field contains 10
characters.
1st Character – File type symbol I.e. if ordinary
file, then the 1st character will be ‘–‘ or if
directory file, then ‘d’ and so on.
2nd , 3rd and 4th Character
– Owner’s read(r), write(w) and execute(x) permission.
I.e. if Owner have read, write and no execute permission on
the file, then 2nd , 3rd and 4th character
will be rw-.
5th ,6th and 7th Character
– Group User’s read (r), write (w) and execute (x) permission.
I.e. if group have read, no write and execute permission on the file, then 5th , 6th and 7th character will
I.e. if group have read, no write and execute permission on the file, then 5th , 6th and 7th character will
be r-x.
8th ,9th and 10th Character
– Other User’s read (r), write (w) and execute (x) permission.
I.e. if other have no read, no write and execute permission
on the file, then 8th , 9th and 10th character
will be --x.
Q) Which command will long list the directory content based
on modification time ?
Ans - $ ls –lt<Enter – Key>
Q) Which command will long list the directory content in
such a way that files and sub – directories available in ascending order based on
the modification time i.e. latest modified file will be available in the end of
the listing of directory content ?
Ans - $ ls –lrt<Enter – Key>
Where r -> reverse
Q) Which command will long list the directory content based
on access time ?
Ans - $ ls –lu<Enter – Key>
Q) Which command will long list the directory content based
on size column in human readable format ?
Ans - $ ls –lh<Enter – Key>
Where h->human readable format
Q) How we see the sub – directories content and files of a
directory i.e Recrusively ?
Ans - $ ls –R<Enter – Key>
If we go for long listing of above command, then $ ls –lR<Enter
– Key>
No comments:
Post a Comment