Skip to main content
added 3 characters in body
Source Link
fedorqui
  • 285.3k
  • 105
  • 579
  • 617

try this simple command

ls -ltq | head -n 1

ls -ltq  <path>  | head -n 1

if uIf you want filefile name - last modified  , path = /ab/cd/*.log

if uIf you want directory name - last modified  , path = /ab/cd/*/

try this simple command

ls -ltq | head -n 1

if u want file name - last modified  , path = /ab/cd/*.log

if u want directory name - last modified  , path = /ab/cd/*/

try this simple command

ls -ltq  <path>  | head -n 1

If you want file name - last modified, path = /ab/cd/*.log

If you want directory name - last modified, path = /ab/cd/*/

Source Link

try this simple command

ls -ltq | head -n 1

if u want file name - last modified , path = /ab/cd/*.log

if u want directory name - last modified , path = /ab/cd/*/