top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration

Facebook Login
Site Registration

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

0 votes
102 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?

Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...