6

I want to know if is possible to make a ls recurrent but without date-time... Hiding the time and date shown when the command ls is executed.

I want to do some thing like

sudo ls -AlhR / > /Volumes/user/Documents/NotProgram.txt

Then, I want to install some program.tar.gz

sudo ls -AlhR / > /Volumes/user/Documents/YesProgram.txt

Compare results Before and After:

diff /Volumes/user/Documents/NotProgram.txt /Volumes/user/Documents/YesProgram.txt

But the differences of Date & Time is detected by diff.

Thank you...

7
  • If you just want the names of the files, find / -print is much cleaner way to get them instead of using ls
    – Munir
    Commented Feb 10, 2017 at 19:02
  • 1
    What are you trying to accomplish ? Commented Feb 10, 2017 at 19:09
  • 1
    Thank you, but I need the size of each file listed.
    – joseluisbz
    Commented Feb 10, 2017 at 19:09
  • I want detect the changes (the files added) made the program installation. using ./configure && make && sudo make install, not prefix, not special conditions.
    – joseluisbz
    Commented Feb 10, 2017 at 19:12
  • A typical case of XY problem... Why don't you ask about your actual problem ? Commented Feb 10, 2017 at 19:25

1 Answer 1

8

Assuming that your /bin/ls is from a relatively recent coreutils, you can use the --time-style option to specify an empty style. For example:

ls -Alhr --time-style=+""

Will get you the same output san the date and time.

4
  • Thank you... but I get this: $ ls -Alhr --time-style=+"" ls: illegal option -- - usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
    – joseluisbz
    Commented Feb 10, 2017 at 19:05
  • On what OS are you running? What package is supplying your /bin/ls? Can you install coreutils? Commented Feb 10, 2017 at 19:09
  • Thank you @Andy-dalton , I discovery that doesn't work in macOS Sierra.
    – joseluisbz
    Commented Feb 10, 2017 at 19:14
  • 1
    You can install coreutils on Mac OS, if that's something you'd consider doing to resolve your problem: apple.stackexchange.com/a/69332 Commented Feb 10, 2017 at 19:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .