LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-19-2005, 09:01 PM   #1
pittopitto
Member
 
Registered: Sep 2005
Location: Australia
Distribution: SUSE Linux Professional 9.3
Posts: 35

Rep: Reputation: 15
Part of files to show in the bash.


Hello folks!

I don't know if I am in the right forum but I have a problem:

I have HUGE txt files, but I am interested in only a very little part of it and it is visualizable when I use this LONG command:

Code:
tail -3 name_file.txt | head -1 | head -c36 | tail -c7
but I would like to have a newline after it. The \n is not recognized in the bash.
How can I do it??

Thanks a lot

G
 
Old 10-19-2005, 09:44 PM   #2
nilleso
Member
 
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372

Rep: Reputation: 31
use \\n

in bash `printf \n` prints "n"
`printf \\n` print a newline

cheers
 
Old 10-19-2005, 09:48 PM   #3
nilleso
Member
 
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372

Rep: Reputation: 31
actually also have a look at cgrep

I'm a cgrep junkie
 
Old 10-19-2005, 10:12 PM   #4
pittopitto
Member
 
Registered: Sep 2005
Location: Australia
Distribution: SUSE Linux Professional 9.3
Posts: 35

Original Poster
Rep: Reputation: 15
Thnks a lot!! It works!!

Ciao
G
 
  


Reply


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
Simple bash script help, grabbing part of a string colabus Linux - Newbie 3 04-25-2005 09:42 AM
configure bash to not show what you type until the prompt juanbobo Linux - Software 1 04-01-2005 01:55 PM
Getting the first part of a filename in a BASH script trevelluk Programming 3 02-15-2005 01:06 AM
xine plays only (a part of) the sound of a wmv, some divx files and crushes mp4 files bezoomny Linux - Software 1 03-10-2004 07:33 PM
Make any console show my username instead of bash? elkrammer Slackware 4 07-23-2002 09:48 AM


All times are GMT -5. The time now is 05:17 PM.

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