DebianThis forum is for the discussion of Debian Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Coreutils 5.2.1 from Sarge stable.
ls -alR /home > overview is supposed to yield a neatly tab-delimited output of all columns in file overview, isn't it?
cut --fields=1-5 overview > overview1 should result in only the first 5 columns being written to overview1, isn't it?
Well, it ISN'T.
Whatever I tried with parameters and also piping 'ls' directly to 'cut', I get no desired result. In all cases the output of 'cut' is the complete 'ls'-overview. Only if I add -s to 'cut' I get a different reslult, an output of _exactly_ 0 bytes, hahaha.
Looking with a hexeditor into overview, yes you are right already, does not show one single tab wherever, only spaces to pad for a nice human-reading.
Using in 'cut' --bytes=1-35 (as example) in stead of --fields=1-5 moreoften shows an unusable result (last column cut off or next column already in the picture) as it gives the desired output:
-rw-r--r-- 1 peter peter 82123
drwxr-xr-x 2 peter peter 48 Fe
a) has anyone of you encountered the same problem?
b) has anyone of you maybe a solution to add the tabs in 'ls'? Or is this a more or less severe bug in 'ls'?