How to recursively list all files and directories

前端 未结 8 1779
长发绾君心
长发绾君心 2021-02-01 03:32

Using the tcsh shell on Free BSD, is there a way to recursively list all files and directories including the owner, group and relative path to the file?

ls -alR comes cl

8条回答
  •  感情败类
    2021-02-01 04:09

    Simple way I found was this:

    ls -lthr /path_to_directory/*

    " * " - represents levels.

    Ajiths-MBP:test ajith$ ls -lthr *
    test2:
    total 0
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:22 test2.txt
    
    test3:
    total 0
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:22 test3.txt
    
    test1:
    total 0
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:21 test1.txt
    drwxr-xr-x  3 ajith  staff    96B Oct 17 18:22 test1_sub_dir
    
    
    Ajiths-MBP:test ajith$ ls -lthr */*
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:21 test1/test1.txt
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:22 test2/test2.txt
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:22 test3/test3.txt
    
    test1/test1_sub_dir:
    total 0
    -rw-r--r--  1 ajith  staff     0B Oct 17 18:22 test1_sub_file.txt
    

提交回复
热议问题