How do I print the file list in a directory?

Asked by Douglas

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:
Last query:
Last reply:
Revision history for this message
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

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#2

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.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#3

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

Revision history for this message
Ralph Corderoy (ralph-inputplus) said :
#4

Do you mean print to paper?

Revision history for this message
Douglas (douglaswingert) said :
#5

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