Solved

Extract Columns From la -al

Posted on 2011-09-08
4
329 Views
Last Modified: 2012-05-12
I run ls -la to get:

oracle@bb0:~/scripts$ ls -la /tmp/score_provider_delete.lst
-rw-r--r--   1 oracle   oracle       264 Sep  8 12:45 /tmp/score_provider_delete.lst
What is the easiest way to extract just the Sep 8 12:45?
Must i use awk or is there something more accessable?
0
Comment
Question by:xoxomos
  • 2
4 Comments
 
LVL 21

Accepted Solution

by:
Papertrip earned 125 total points
ID: 36506273
ls -la /tmp/score_provider_delete.lst | awk '{print $6,$7,$8}'

Open in new window

0
 
LVL 7

Assisted Solution

by:jackiechen858
jackiechen858 earned 50 total points
ID: 36506352
ls -la | awk '{print $6" "$7" "$8}'


0
 
LVL 21

Expert Comment

by:Papertrip
ID: 36506379
...

Or just do it how I wrote, which is a syntax that is easier on the eyes than all those quotes.  Just use commas as I originally posted.

0
 

Author Closing Comment

by:xoxomos
ID: 36506434
So is guess awk it is.
Thanks
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Remove a very long string from all files in Linux 6 84
Linux Scripting 3 96
linux ssh 4 57
Penetration Testing home based work 3 47
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now