Search code examples
linuxshellls

Show filename, date, size in shell


I have a newbie question regarding linux command ls. How can I only show the filename(without the full path), the size of the file and the date? for example I want to show somehting like this:

somehting.jpg 4096 04/05/2015

Solution

  • You can use find command:

    find . -maxdepth 1 -printf '%f %n %CY-%Cm-%Cd\n'
    

    to get in the format you want. You can adjust the directory path to whatever path you want to use.