Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-29-2006, 10:17 AM   #1
LQ Newbie
Registered: May 2006
Posts: 20

Rep: Reputation: 0
shell program, how to find substring plz

hi, could u plz tell , how to pick a part of the
command result like finding substring.

i need to use ls -sh /home/oracle/data1.dbf
it gives 100m /home/oracle/data1.dbf
i want to display only the size 100m
should use any substring concept? or any other
simple method.
Old 12-29-2006, 10:43 AM   #2
Senior Member
Registered: Sep 2005
Location: France
Distribution: approximately NixOS (
Posts: 1,900

Rep: Reputation: 69
du -sh file | cut -f 1

man du, man cut, man ls, man sed...


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
linux shell program problem plz madhugp Programming 4 12-25-2006 10:53 AM
shell commad doubt plz madhugp Linux - General 3 12-24-2006 10:08 AM
php preg_replace substring of a substring senyahnoj Programming 5 12-08-2006 11:31 AM
Shell script: Delete filenames containing a substring? Drack Linux - General 4 02-12-2006 03:11 PM
how to find an exact substring match? ldp Programming 7 02-22-2005 06:28 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:58 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration