- Information
- AI Chat
Was this document helpful?
Unix Modul 2 - Ntg
Course: Software Engineering (CS530)
376 Documents
Students shared 376 documents in this course
University: Visvesvaraya Technological University
Was this document helpful?
Module 02
Chapter 01
File Attributes & Permissions
The ls command with options:
The ls command is to obtain a list of all file names in the current directory. ls with options:
Option Description
-x Multicolumnar Output
-F Marks executables with *, directories with / and symbolic link with @
-a Shows all filenames beginning with a dot including . and ..
-R Recursive list
-r Sorts filenames in reverse order(ASCII collating sequence by default)
-l Long listing in ASCII collating sequence seven attributes of a file.
-d dirname Lists only dirname if dirname is a directory.
-t Sort filenames by last modification time.
-lt Sorts listing by last modification time.
-u Sorts filenames by last access time.
-lu Sorts by ASCII collating sequence but listing shows last access time.
-i Displays inode number.
Listing File Attributes(ls –l):
ls command is used to obtain a list of all filenames in the current directory. The output in
UNIX lingo is often referred to as the listing. Sometimes we combine this option with other
options for displaying other attributes, or ordering the list in a different sequence. ls look up the
file‘s inode to fetch its attributes. It lists seven attributes of all files in the current directory and
they:
1. File type & Permission: The first column shows the type and permissions associated with
each file. The first character in this column is mostly a -, which indicates that file is an ordinary
one.
2. Links: The second column indicates the number of links associated with the file. This is
actually the number of filenames maintained by the system of that file.
3. Ownership:When you create a file, you automatically become its owner. The third column
shows kumar is the owner of all of these files. The owner has full authority to tamper with a
files contents and permissions—a privilege not available with others except the root user.
4. Group Ownership: The fourth column represents the group owner of the file. Every user is
attached to a group owner. Every member of that group can access the file depending on the
permission assigned.
5. File size: File size in bytes is displayed. It is the number of character in the file rather than
the actual size occupied on disk.
6. Last modification time: Last modification time is the next field. If you change only the
permissions or ownership of the file, the modification time remains unchanged. If at least one
character is added or removed from the file then this field will be updated.
7. File name: The last column displays the filenames arranged in ASCII collating sequence.