How do I print the file list in a directory?

Asked by Douglas on 2011-02-01

I would like to print the contents of a directory how can I do that? I would also like to print the contents of a file if that is possible.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu coreutils Edit question
Assignee:
No assignee Edit question
Solved by:
Douglas
Solved:
2011-02-01
Last query:
2011-02-01
Last reply:
2011-02-01
mycae (mycae) said : #1

use "ls" to list directory contents

use "cat" to print file contents (warning, this will only give the expeted result for text files)

http://www.ubuntupocketguide.com/index_main.html

Chapter 5 I think

If you want to view a text file so that you can scroll up and down with the keyboard, you can use "less" instead of "cat".

For detailed information and advanced usage on these commands, you can use the "man" command (which stands for "manual"). So, for example, you can run "man ls" to get information on the ls command, and "man man" to get information on the man command itself. Manpages can also be viewed online at http://manpages.ubuntu.com/, and if you want to graphically, you can do that in the help browser (yelp).

In "less" and "man" you can scroll up and down a page at a time with Page Up and Page Down, and also with B and Spacebar. Press 'q' to quit.

Correction: "and if you want to graphically" --> "and if you want to view them locally"

Do you mean print to paper?

Douglas (douglaswingert) said : #5

This solved my problem. Thanks for the assistance.....what a great community!