Get the most out of your Centmin Mod LEMP stack
Become a Member

Linux ls command tricks

Discussion in 'System Administration' started by eva2000, Mar 25, 2015.

  1. eva2000

    eva2000 Administrator Staff Member

    49,875
    11,486
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,838
    Local Time:
    3:11 PM
    Nginx 1.21.x
    MariaDB 10.x
    This article is a nice read for list command tricks for ls command 7 Quirky 'ls' Command Tricks Every Linux User Should Know


    particularly like these

    Code:
    ls --format=across
    ls --format=comma
    ls --format=horizontal
    ls --format=long
    ls --format=single-column
    ls --format=verbose
    ls --format=vertical
    example
    Code:
    ls
    CHANGES  CHANGES.ru  LICENSE  Makefile  README  auto  conf  configure  contrib  html  man  objs  src
    
    Code:
    ls --format=across
    CHANGES  CHANGES.ru  LICENSE  Makefile  README  auto  conf  configure  contrib  html  man  objs  src
    
    Code:
    ls --format=comma
    CHANGES, CHANGES.ru, LICENSE, Makefile, README, auto, conf, configure, contrib, html, man, objs, src
    
    Code:
    ls --format=horizontal
    CHANGES  CHANGES.ru  LICENSE  Makefile  README  auto  conf  configure  contrib  html  man  objs  src
    
    Code:
    ls --format=long     
    total 656
    -rw-r--r-- 1 1001 1001 246649 Feb 10 14:33 CHANGES
    -rw-r--r-- 1 1001 1001 375103 Feb 10 14:33 CHANGES.ru
    -rw-r--r-- 1 1001 1001   1397 Feb 10 14:33 LICENSE
    -rw-r--r-- 1 root root    360 Mar 14 19:13 Makefile
    -rw-r--r-- 1 1001 1001     49 Feb 10 14:33 README
    drwxr-xr-x 6 1001 1001   4096 Mar 14 19:10 auto
    drwxr-xr-x 2 1001 1001   4096 Mar 14 19:10 conf
    -rwxr-xr-x 1 1001 1001   2463 Feb 10 14:33 configure
    drwxr-xr-x 4 1001 1001   4096 Mar 14 19:10 contrib
    drwxr-xr-x 2 1001 1001   4096 Mar 14 19:10 html
    drwxr-xr-x 2 1001 1001   4096 Mar 14 19:10 man
    drwxr-xr-x 4 root root   4096 Mar 14 19:15 objs
    drwxr-xr-x 8 1001 1001   4096 Mar 14 19:10 src
    
    Code:
    ls --format=single-column
    CHANGES
    CHANGES.ru
    LICENSE
    Makefile
    README
    auto
    conf
    configure
    contrib
    html
    man
    objs
    src
    
    Code:
    ls --format=verbose     
    total 656
    -rw-r--r-- 1 1001 1001 246649 Feb 10 14:33 CHANGES
    -rw-r--r-- 1 1001 1001 375103 Feb 10 14:33 CHANGES.ru
    -rw-r--r-- 1 1001 1001   1397 Feb 10 14:33 LICENSE
    -rw-r--r-- 1 root root    360 Mar 14 19:13 Makefile
    -rw-r--r-- 1 1001 1001     49 Feb 10 14:33 README
    drwxr-xr-x 6 1001 1001   4096 Mar 14 19:10 auto
    drwxr-xr-x 2 1001 1001   4096 Mar 14 19:10 conf
    -rwxr-xr-x 1 1001 1001   2463 Feb 10 14:33 configure
    drwxr-xr-x 4 1001 1001   4096 Mar 14 19:10 contrib
    drwxr-xr-x 2 1001 1001   4096 Mar 14 19:10 html
    drwxr-xr-x 2 1001 1001   4096 Mar 14 19:10 man
    drwxr-xr-x 4 root root   4096 Mar 14 19:15 objs
    drwxr-xr-x 8 1001 1001   4096 Mar 14 19:10 src
    
    Code:
    ls --format=vertical
    CHANGES  CHANGES.ru  LICENSE  Makefile  README  auto  conf  configure  contrib  html  man  objs  src
    
     
    Last edited: Mar 25, 2015