LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 06-05-2009, 02:45 PM   #1
yanghwanim
LQ Newbie
 
Registered: Mar 2009
Location: Honolulu, Hawaii
Distribution: CentOS/Fedora/Ubuntu/RedHat
Posts: 18

Rep: Reputation: 0
Question Reading '--help' in Linux


I am confused on something. Lets say that I enter a command of # ls --help

and it echos out this:

sean@thebrains:~$ ls --help
Usage: ls [OPTION]... [FILE]...
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.

Mandatory arguments to long options are mandatory for short options too.
-a, --all do not ignore entries starting with .
-A, --almost-all do not list implied . and ..
--author with -l, print the author of each file
-b, --escape print octal escapes for nongraphic characters
--block-size=SIZE use SIZE-byte blocks
-B, --ignore-backups do not list implied entries ending with ~
-c with -lt: sort by, and show, ctime (time of last
modification of file status information)
with -l: show ctime and sort by name
otherwise: sort by ctime
-C list entries by columns
--color[=WHEN] control whether color is used to distinguish file
types. WHEN may be `never', `always', or `auto'

-------------------------
Now if you look at the top argument ' -a --all' does the --all mean that, that is the long way to write the argument? Also '-A --almost-all, and the --author, what does that imply, that I need to use:'ls -A --almost-all --author' ??

Sorry for being a complete dumba**....
 
Old 06-05-2009, 02:48 PM   #2
pkraus109
LQ Newbie
 
Registered: Mar 2004
Posts: 23

Rep: Reputation: 16
-a, --all do not ignore entries starting with .

-a and --all are the same command just two different methods of writing it. The more common practice now adays is to use the "long format" or the --all.

-A, --almost-all do not list implied . and ..
These two statements are also the same see explaniation above HOWEVER they are not the same as "-a --all" I suggest you run the two to see the difference.


ls --all
ls --almost-all

HTH,
Paul
 
Old 06-05-2009, 02:50 PM   #3
CSIG
LQ Newbie
 
Registered: Apr 2008
Posts: 11

Rep: Reputation: 1
If you have difficulties with the built-in help response, then try 'man ls' or 'info ls'. Maybe these will be more readable to you.
 
Old 06-05-2009, 02:53 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Quote:
-A, --almost-all do not list implied . and ..
You have to read this statement literally: "do not list implied dot and dot dot". This means it does not list the shortcut of the current directory (dot) and the shortcut for the upper level directory (dot dot).
 
Old 06-05-2009, 03:02 PM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
AIUI, the long forms of options are designed mostly for use inside of scripts, where readability (i.e. quickly understanding what the command is doing) is important, and the effort of typing the full string only has to be done once.

For regular command line use, the short forms are more natural.

The "--help" option is usually only used as a quick reference. As mentioned above, read the man or info pages for detailed usage information.
 
Old 06-05-2009, 03:19 PM   #6
noctilucent
Member
 
Registered: Jun 2009
Distribution: slackware
Posts: 123

Rep: Reputation: 34
Quote:
Originally Posted by pkraus109 View Post
The more common practice now adays is to use the "long format"
Is it? How do you know this? And do you happen to know why 'generally' long options are preferred?
 
Old 06-05-2009, 05:42 PM   #7
yanghwanim
LQ Newbie
 
Registered: Mar 2009
Location: Honolulu, Hawaii
Distribution: CentOS/Fedora/Ubuntu/RedHat
Posts: 18

Original Poster
Rep: Reputation: 0
I always assumed the short way was more popular, however the long way is easier to humanly understand.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
reading linux with windows ??? tbrownarcher Linux - Newbie 3 12-12-2007 12:24 AM
Linux reading carlosinfl Linux - General 1 01-28-2005 01:01 AM
Reading CD RW on Linux aroop Linux - General 5 06-23-2004 10:31 PM
best fs for both xp and linux reading niehls Linux - General 4 07-16-2003 01:31 PM
cd-rw reading in linux TNJed Linux - Newbie 3 09-01-2002 11:46 AM

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

All times are GMT -5. The time now is 10:59 PM.

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
Open Source Consulting | Domain Registration