Linux Operating System (MOSC)

MOSC Banner

Display dir name in ls -lhtra

edited Mar 8, 2017 3:37PM in Linux Operating System (MOSC) 4 commentsAnswered ✓

OS: Red Hat Linux 6.8

DB: Oracle 11.2.0.3.0 

Question: I have written a small script that gives me the list of files and their size in 3 directories. But it does not gives me directory names. Please advice how to get that directory name? Currently, I can only run it from my directory. Is there anything I can do to run it from any other directory and get the same results?

Scirpt:

#!/bin/sh

ls -lhtra /oracle-backups/test1/backups

ls -lhtra /oracle-backups/test2/backups

ls -lhtra /oracle-backups/test3/backups

Thanks for your help.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center