[ale] how do I list big files

Ed Cashin ecashin at noserose.net
Sun Mar 20 13:24:34 EDT 2011


When Linux starts a shell process, it usually has the three
normal file descriptors open.  File descriptors are numbers.

 0 is the "standard input" file descriptor, the one where
    a Linux process expects to read input.

 1 is the "standard output" file descriptor, the one where
    a Linux process expects to print output.

 2 is the "standard error" file descriptor, the one where
    a (well behaved) Linux process prints error messages
    and warnings.

You can think of these numbers as indexes into an array
of the files you have open.  If you open a new file, there's
some new file descriptor ready for you to use.

In the bash shell and its predecessor the Bourne shell,
you use file descriptors explicitly with the redirection
syntax, using stuff like,

  >
  <
  >>
  <<

It can be a little confusing at first because in addition to
file descriptors, you can use file names with those.

In the example below I use a function that prints "output"
to standard output and "error" to standard error.  Both are
my terminal until I redirect them.

bash$ example() { echo output; echo error 1>&2; }
bash$ example
output
error
bash$ example > output_file
error
bash$ cat output_file
output
bash$ example 2> error_file
output
bash$ cat error_file
error
bash$ example > out_and_error_file 2>&1
bash$ cat out_and_error_file
output
error
bash$

There are some online documents providing good
introductions to file descriptors in Linux.

On Sun, Mar 20, 2011 at 11:29 AM, Ron Frazier
<atllinuxenthinfo at c3energy.com> wrote:
> Not totally sure what you were getting at on this one.
>
> Ron
>
> On 03/20/2011 10:22 AM, Michael Trausch wrote:
>>
>> Redirect FD nuumber 2, not CD number 2. FD == file descriptor, a low
>> level UNIX concept not unlike what Windows calls a "handle".
>>
>> --
>> Sent from my phone... a G2 running CM7 nightlies!
>>
>>
>
> --
>
> (PS - If you email me and don't get a quick response, you might want to
> call on the phone.  I get about 300 emails per day from alternate energy
> mailing lists and such.  I don't always see new messages very quickly.)
>
> Ron Frazier
>
> 770-205-9422 (O)   Leave a message.
> linuxdude AT c3energy.com
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>



-- 
  Ed Cashin <ecashin at noserose.net>
  http://noserose.net/e/
  http://www.coraid.com/



More information about the Ale mailing list