If I may give some friendly advice...
1) To start with, please use a thread title that has some relevance to your specific problem. "
command" could mean almost anything. "
Printing only one column?" would be much clearer, and readers who are likely to know the answer will be more likely to click on it.
2) When you post a problem you really need to give more details. Start by explaining the background of your situation, including the environment and tools that are available to you (particularly if it's not a standard Linux setup). Otherwise we have to make assumptions and/or ask you clarifying questions before we can help you.
Then (for text-processing questions at least), provide an
actual example of both the input text and the desired output. Finally, be sure to mention any attempts you've already made, and the results you got, including error messages.
Of course, you do have to balance it too. Don't overwhelm us with more detail than is needed to understand your situation.
3) Please take the time to do some research before you post, particularly for common actions like this. There's a whole internet full of advice out there, in addition to the LinuxQuestions archives. A few minutes of searching would certainly answer your question for you, or at least give you leads about where to look next.
4) Finally, when you have time, please read
How To Ask Questions The Smart Way. Expressing your questions properly will maximize your chances of getting good results, and save everyone, including you, a lot of time and hassle.
Incidentally, most text processing is done with
grep,
sed,
awk, and the various
coreutils like
cut. Each of these has both
man pages and
info pages detailing their options and use, as well as countless examples on the internet.
I particularly recommend taking a look at "
info coreutils" for a detailed list of all the applications that it provides.
The shell itself has several built-in features for
string manipulation too.
4) Finally, when you have time, please read
How To Ask Questions The Smart Way. Expressing your questions properly will maximize your chances of getting good results, and save everyone, including you, a lot of time and hassle.
Good luck!