LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 06-26-2013, 04:13 AM   #1
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 177

Rep: Reputation: Disabled
how to format output file in linux?


Everyone here know that ls command shows content in a directory.

let's imagine that I have 001, 002, 003, 004 and 005 files in ~/test directory.
So, if I do this
Quote:
$ ls ~/test > mytest.txt
, I get mytest.txt file which reads
Quote:
001
002
003
004
005
In this example, I don't want mytest.txt file reads like that. I want mytest.txt file reads like this
Quote:
001 002 003 004 005
.
how can I do that. any help please!
I have all man pages of less, grep, cut, diff, etc... commands.
But I couldn't find out which command I can use.
Just everything in my head went messed up

Last edited by mshlinux; 06-26-2013 at 04:15 AM.
 
Old 06-26-2013, 04:16 AM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

Code:
cd ~/test
echo * > ../mytest.txt
Evo2.
 
Old 06-26-2013, 04:57 AM   #3
mshlinux
Member
 
Registered: Mar 2013
Location: Yangon, Myanmar.
Distribution: Fedora, Arch
Posts: 177

Original Poster
Rep: Reputation: Disabled
oh! thank you so much.
your command is exactly what I want.
 
  


Reply



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
[SOLVED] scripts file output format gone messy slowerogue Linux - Newbie 5 02-21-2013 10:37 PM
How to convert Tcpdump output file to a Pcap format? gabriel01 Linux - Networking 6 11-26-2012 04:50 AM
Exporting output of a file to a non-editable file format HogFather Linux - Enterprise 6 03-09-2012 03:56 AM
Putty using csv files in BASH to format file in script as output smks Linux - Newbie 7 12-22-2011 05:50 PM
i need to output a text file in proper format anurupr Linux - Newbie 2 03-04-2010 03:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 08:49 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration