The Open Source Swiss Army Knife

/unix/commandline/
/unix/commandline/ + sub-categories
http://www.sirfsup.com/
web directory content
    
      

Not logged in
Chat Register Login
return to:  http:/www.sirfsup.com      /unix   /commandline 
Permalink: ls.htm
Title: add
article options : please login   |  print view

getting around with commands on linux: ls

  1. ls

ls

ls -lh
which will print out file size in human readable sizes
ls -a
does not hide files which begin with a .
ls -l /lib/libc*
goes through and just displays /lib/libc* matches
timestamps
ls -ld
shows the directories without descending into them and listing the files contained therein
ls -lt
sorts by timestamp allowing a visual diff of new files and old, allowing piping into another program and separating files according to time.
the '-t' causes a sort
ls -l
last modification timestamp
ls -lu
last access timestamp
ls -lc
information about the file has changed, but not the file itself
ls -ls and ls -la: why the different totals?? what is the total reflecting?
[root@www sessions]# ls -ls
total 12
   4 -rw-------    1 joe      mail           24 Mar  9 07:21 joe-session-0.0109632721441848
   4 -rw-------    1 joe      mail           24 Mar  9 07:39 joe-session-0.550197762743668
   4 -rw-------    1 joe      mail           24 Mar  9 07:22 joe-session-0.718532812389643
[root@www sessions]# ls -la
total 20
drwxr-xr--    2 joe      users        4096 Mar  9 07:22 .
dr-xr-xr-x    9 joe      users        4096 Mar  9 07:21 ..
-rw-------    1 joe      mail           24 Mar  9 07:21 joe-session-0.0109632721441848
-rw-------    1 joe      mail           24 Mar  9 07:39 joe-session-0.550197762743668
-rw-------    1 joe      mail           24 Mar  9 07:22 joe-session-0.718532812389643
[root@www sessions]#
that 4k blocks are used up as the smallest block size, so total = 20k really which breaks down to 4k per file, including directories?

Leave a Reply
Your Name:     anonymous
Your Email:
Website:  
Comments:

The author will be notified of your reply.
return to top