top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

OS : How does "ls * > output.txt" work ?

0 votes
487 views
OS : How does "ls * > output.txt" work ?
posted Jul 23, 2014 by Harshita

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

2 Answers

+2 votes

The symbol '>' represents output redirection. Normally "ls" outputs the result on the screen (stdout).

But "ls * > output.txt" redirects/forces the result to be stored in the file you mentioned, i.e.output.txt. So it does not display anything on the screen and stores the result in the file output.txt.

Hope this helps.

answer Jul 24, 2014 by Ankush Surelia
0 votes

'ls' will provide the list of files and folders on the current directory.

'ls *' will provide the list of files and folders and subfolders on the current directory.

'ls * > output.txt` will redirect the output (files and folders and subfolders on the current directory) to the output.txt file

answer Aug 5, 2014 by Dhanish Jose
Similar Questions
+2 votes

Lets assume that i have 2 OS installed, (Linux and Windows).

Both have different file system and both have different mechanism to read/write files.

Then how both OS Shares file information?

...