The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Can we use 'tr' command to print 5th column of output of 'ls -l'
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Directory
Register
Forum Rules
FAQ
Contribute
Members List
Search
Today's Posts
Mark Forums Read
Thread
:
Can we use 'tr' command to print 5th column of output of 'ls -l'
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
5
(
permalink
)
09-17-2007
Nidhi2177
Registered User
Join Date: Sep 2007
Posts: 9
Thanks All,
I have got the solution..
lines=`ls -l | tr -s [:space:] | cut -d ' ' -f 5 | wc -l`
lines=`expr $lines - 1`
echo "Fifth column of 'ls -l' command:::"
ls -l | tr -s [:space:] |cut -d ' ' -f 5 | tail -n $lines
Nidhi2177
View Public Profile
Find all posts by Nidhi2177