Ads

11 April, 2016

Listing Files

Posted By: Unknown - 10:12 PM
To list the files and directories stored in the current directory. Use the following command −
$ls
Here is the sample output of the above command −
$ls

bin        hosts  lib     res.03
ch07       hw1    pub     test_results
ch07.bak   hw2    res.01  users
docs       hw3    res.02  work
The command ls supports the -l option which would help you to get more information about the listed files −
$ls -l
total 1962188

drwxrwxr-x  2 amrood amrood      4096 Dec 25 09:59 uml
-rw-rw-r--  1 amrood amrood      5341 Dec 25 08:38 uml.jpg
drwxr-xr-x  2 amrood amrood      4096 Feb 15  2006 univ
drwxr-xr-x  2 root   root        4096 Dec  9  2007 urlspedia
-rw-r--r--  1 root   root      276480 Dec  9  2007 urlspedia.tar
drwxr-xr-x  8 root   root        4096 Nov 25  2007 usr
drwxr-xr-x  2    200    300      4096 Nov 25  2007 webthumb-1.01
-rwxr-xr-x  1 root   root        3192 Nov 25  2007 webthumb.php
-rw-rw-r--  1 amrood amrood     20480 Nov 25  2007 webthumb.tar
-rw-rw-r--  1 amrood amrood      5654 Aug  9  2007 yourfile.mid
-rw-rw-r--  1 amrood amrood    166255 Aug  9  2007 yourfile.swf
drwxr-xr-x 11 amrood amrood      4096 May 29  2007 zlib-1.2.3
$
Here is the information about all the listed columns −
  • First Column: represents file type and permission given on the file. Below is the description of all type of files.
  • Second Column: represents the number of memory blocks taken by the file or directory.
  • Third Column: represents owner of the file. This is the Unix user who created this file.
  • Fourth Column: represents group of the owner. Every Unix user would have an associated group.
  • Fifth Column: represents file size in bytes.
  • Sixth Column: represents date and time when this file was created or modified last time.
  • Seventh Column: represents file or directory name.
In the ls -l listing example, every file line began with a d, -, or l. These characters indicate the type of file that's listed.
PrefixDescription
-Regular file, such as an ASCII text file, binary executable, or hard link.
bBlock special file. Block input/output device file such as a physical hard drive.
cCharacter special file. Raw input/output device file such as a physical hard drive
dDirectory file that contains a listing of other files and directories.
lSymbolic link file. Links on any regular file.
pNamed pipe. A mechanism for interprocess communications
sSocket used for interprocess communication.


About Unknown

I'm Monarul Islam Monir . I am a very passionate, diligent and focused engineer some years of cumulative experience as a system admin, desktop support engineer with technical knowledge and proficiency in system administration, network maintenance, hardware maintenance, operating systems, Linux, Windows (All versions) and I am willingness to learn and effectively apply new technologies.I'm MCP,MCSA certified from Microsoft corporation. I am also an analytical thinker, consistently resolving ongoing issues, often called upon to consult on problems that have eluded resolution by others. I have an extensive exposure to a comprehensive range of team activities; thrive on working in challenging environment. I can demonstrate problem analysis, resolution skills, ability to troubleshoot, solve problems quickly and completely. Excellent client management skills innate ability to build strong, lasting and mutually beneficial relationships. I can work both full-time and as a freelancer, whichever meets your needs. Call now and let's hook up for business.

© 2016 - Designed by: MONIR IT