LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2018, 03:19 AM   #1
kamtarias
LQ Newbie
 
Registered: May 2018
Posts: 3

Rep: Reputation: Disabled
ls -f


Please help me to understand purpose of command "ls -f"
 
Old 05-29-2018, 03:31 AM   #2
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Outside, most of the time.
Posts: 865
Blog Entries: 25

Rep: Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527Reputation: 527
Man-Pages

Quote:
Originally Posted by kamtarias View Post
Please help me to understand purpose of command "ls -f"
Code:
user@machine:~$ man ls
Done.
 
Old 05-29-2018, 11:12 AM   #3
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,511

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Hi kamtarias,

Welcome!

Every Linux command has a man page. See above.
 
1 members found this post helpful.
Old 05-29-2018, 12:42 PM   #4
MadeInGermany
Senior Member
 
Registered: Dec 2011
Location: Simplicity
Posts: 1,288

Rep: Reputation: 591Reputation: 591Reputation: 591Reputation: 591Reputation: 591Reputation: 591
Normally ls sorts. And normally this is very little overhead.
But if there are many (say >10000) files, then ls -f is faster (and takes less resources), because it prints the files as they are found in the directory table, that is unsorted. (Like find does - but ls -f is faster).
 
1 members found this post helpful.
Old 05-29-2018, 02:19 PM   #5
X-LFS-2010
Member
 
Registered: Apr 2016
Posts: 423

Rep: Reputation: Disabled
Quote:
Originally Posted by kamtarias View Post
Please help me to understand purpose of command "ls -f"
it is for generating a text list of directory/file entries in the order linux kernel and underlying filesystem list them

it is also for quickly getting a file list without waiting for sorting

the "purpose" for having the list is for further processing
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration