So I created two files, each with 127,955 lines and 24 random characters per line. As far as text the two files were completely identical. However one file had Unix line breaks and the other had Windows line breaks. The file with Unix line breaks was 3,124 KB, while the file with Windows line breaks was 3,249 KB. There were no other differences between the files so I have to assume that for some reason Windows line breaks take up more space. Any idea why?
123086
Just out of curiousity.. Why are the line endings different for Windows and Unix.  I was looking around for the answer but not found.
3684
I'm on FreeBSD, using a wide xterm with, say, 132 characters per line. When running  $ man man   the manual page is formatted to fit an 80 character per line terminal width. Is there a way to make the formatter (groff, grotty) use a line width I specify?  I read the manuals for man(1) and groff(1) but could not find an appropriate option. I know it can be done, since I have seen it work on some Linux distro.
60394
I've been wondering this for a while, why is there free space at the end of a drive that was formatted to NTFS in windows?  You can only see the unallocated space in Linux. So why is it there? Does it serve a purpose?
5272
Here is the thing, I have always used a blank space between paragraphs in order to tell latex that there is a new paragraph. But there is someone I work with very often that keeps using \\ to break a line after a paragraph...  This is really annoying so I wanted to know if there is a real advantage of using \\ over just leaving a space.  Note that I am not referring to the paragraph environment, but to the simple term paragraph.
31465
How can I make a pair of words stick together in line breaks? For example, "MS Access". I don't want a line break in the middle. But, I'd like to set this up once, not at  every occurrence of that word pair.  edit: Check out Sveinung's answer for two possible problems - overfull line, and hyphenation. For sure, I don't want that.
110061
To output all lines into a file /tmp/ps.txt  $ ps -e &gt;/tmp/ps.txt       To count it with wc -l  $ wc -l /tmp/ps.txt 172   To count it without exporting a file.  $ ps -e | wc -l 173   Why ps -e | wc -l  get one more line?  I don't think  for my question.  $ echo "test" | wc -l 1   Please try it in your terminal, it would yield 2 as .
17335
file_A (~500MB, 1.6M lines) consists of all equal length search terms, 1 per line, not sorted.  file_B consists of all equal length text lines, 1 per line, not sorted  I've been able to run "grep -F -f file_A file_B >> output.txt" with any size file_B without problem on a box with 52GB ram. Problem is I'm now limited to 4GB ram and thus the size of file_A is now too large for this to run without exhausting available memory.  Short of manually chopping up file_A into smaller bites, is there any easy way to script this to grep for first 1000 lines of file_A, then when thats finished to automatically grep for lines 1001-2000, ect. until I've gone through all of file_A?
111950
I have a huge text file (~1GB) and sadly the text editor I use won't read such a large file.  However, if I can just split it into two or three parts I'll be fine, so, as an exercise I wanted to write a program in python to do it.    What I think I want the program to do is to find the size of a file, divide that number into parts, and for each part, read up to that point in chunks, writing to a filename.nnn output file, then read up-to the next line-break and write that, then close the output file, etc.  Obviously the last output file just copies to the end of the input file.  Can you help me with the key filesystem related parts: filesize, reading and writing in chunks and reading to a line-break?  I'll be writing this code test-first, so there's no need to give me a complete answer, unless its a one-liner ;-)
35181
I have a big file and need to split into two files. Suppose in the first file the 1000 lines should be selected and put into another file and delete those lines in the first file.  I tried using split but it is creating multiple chunks.
80255
If parsing the output of ls is dangerous because it can break on some funky characters (spaces, \n, ... ), what's the best way to know the number of files in a directory?  I usualy rely on find to avoid this parsing, but similarly, find mydir | wc -l will break for the same reasons.  I'm working on Solaris right now, but I'm looking for a answer as portable across different unices and different shells as possible.
74112
I know that I can use something like cat test.txt | pr -w 80 to wrap lines to 80 characters  wide, but that puts a lot of space on the top and bottom of the printed lines and it does not work right on some systems  What's the best way to force a text file with long lines to be wrapped at a certain width?   Bonus points if you can keep it from breaking words.
123475
If I have a number of directories, named, for example 10001 through 10025 is there any reason to use ls 1*/foo vs. ls 100??/foo?  I have a lot more than 25 of them, so I mostly curious if there's any differences in speed.  I know the difference in use between the two, that the asterisk will match longer file names, like 10001.backup. But let's say I don't have any files that don't follow my conventions. Is there any behind-the-scenes differences?
70815
I have seen solutions of splitting a file with respect to pattern matching and line matching but what I want is the following.  The scenario is, let's say I have a file file1  -   A.B|100|20 A.B|101|20 A.X|101|30 A.X|1000|20 B.Y|1|1   Now I want to split this file into 3 different files just based on the first column where the 1st file would be all the lines containing A.B in the first column, the 2nd file should have all the lines with A.X and so on.  If the first column changes in  any way, there should be a new file created for those lines. Is there any way of doing it with bash  or awk?  Since there is no way of actually knowing before hand what the first column value is, I wasn't able to use any feature like split or cut. Thanks for the help in advance!
48925
It's hard to search for special characters on google, which is why I'm posting this here.  I recently ran (as root) a mv /tmp/folder/* /* when I meant to run mv /tmp/folder/* ./ Big mistake!  Things broke! A lot of files got mixed up and placed into strange places, none of the normal unix commands worked (ls, dir, cat, etc) and once you logged off, you couldn't ssh back in -- it would give you a prompt, but not accept the old passwords.  Running ls /* shows me that it performs ls on every directory in /. If I tried to draw a parallel, then mv should have simply moved (or copied?) the files to every directory in /. Instead, really weird things happened, and I was just curious what exactly was going on.  More info: The files in /tmp/folder had been transferred from a windows machine, and had been named file (#).txt, where (#) is a number up to two digits, with a space between file and the parenthesis. There were ~40 of these text files.
48641
I need to split a .txt file into smaller ones containing 100 lines each, including the header. I don't know if this is relevant, but the original file is delimited like this:  COLUMN1 | COLUMN2 | COLUMN3 1 | 2 | 3 4 | 5 | 6 7 | 8 | 9   I need every file generated from this split to have the header line. Also, they need to be generated in/moved to another directory and follow a name pattern, like file_01.txt, file_02.txt, etc
93075
If I want to tail a 25 GB textfile, does the tail command read the whole file?  Since a file might be scattered on a disk I imagine it has to, but I do not understand such internals well.
93860
On Windows 7, I have a directory containing the following four files:   xxx.txt xxx.txt2 xxx2.txt xxx2.txt2   With the file have more than 3 character as a file extension, the behavior of the wildcard * seems odd:  dir *.txt  10/13/2014  04:14 PM                 6 xxx.txt 10/13/2014  04:17 PM                 6 xxx2.txt 10/13/2014  04:17 PM                 6 xxx2.txt2 10/13/2014  04:14 PM                 6 xxx.txt2            4 File(s)             24 bytes            0 Dir(s)   6,660,980,736 bytes free   I would expect to see only the two files with txt extension and not the ones with txt2 (like it would on a Linux machine). Does MS-DOS ignore the truncate the file extension to 3 characters or does it add automatically another wildcard at the end? If I want to delete only the files with txt extension and not the one with txt2, which command should I use? Thanks