Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 26th May 2012, 08:08 AM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
Command question

I am reading a linux text book which has been great so far (http://rute.2038bug.com/node5.html.gz). However, some of the commands that it has been giving me have not been working as described in the book. For example, the book gave me the commands to change directories which have been working but it told me that to view all of the files in a directory I should type in:

ls -l

However, when I typed it in (just after installing adobe flash and in other directories), rather than a list of files I got messages like this:

@localhost Downloads]$ ls -l
total 8
-rw-rw-r--. 1 rootless rootless 4368 May 25 21:29 adobe-release-i386-1.0-1.noarch.rpm



What is it that ls -l does and how do I list the files in a directory?

Thanks!
Reply With Quote
  #2  
Old 26th May 2012, 08:30 AM
stevea's Avatar
stevea Offline
Registered User
 
Join Date: Apr 2006
Location: Ohio, USA
Posts: 8,302
linuxfirefox
Re: Command question

Quote:
Originally Posted by Socrates440 View Post
@localhost Downloads]$ ls -l
total 8
-rw-rw-r--. 1 rootless rootless 4368 May 25 21:29 adobe-release-i386-1.0-1.noarch.rpm
The current directory uses 8 blocks (mostly ignorable).
There is one (non-hidden) file in the directory ,named " adobe-release-i386-1.0-1.noarch.rpm"
That file has rw permissions for user-id "rootless",
has rw permission for group-ig "rootless",
has r permission for everyone else.
The file has 4368 bytes and was last modified on May 25 21:29.


Quote:


What is it that ls -l does and how do I list the files in a directory?

Thanks!
You've got the right tool 'ls' tho 'dir' can do something similar. Try the
man ls
command for more info.
__________________
None are more hopelessly enslaved than those who falsely believe they are free.
Johann Wolfgang von Goethe
Reply With Quote
  #3  
Old 26th May 2012, 11:21 AM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,708
linuxfirefox
Re: Command question

"ls" on its own will list the names of the files in the current directory.

"ls -l" will list them one-per-line, along with a summary of associate meta-data (ownership, permissions, size, etc. as stevea interpreted above).

In general, if you need more information about a specific command, "man command_name" will show the command's manual page. "command --help" (or "-h", "-?" options) gives a briefer summary for most commands. The "info" command often has more detailed documentation than "man", but isn't as straightforward to use.
Reply With Quote
  #4  
Old 26th May 2012, 04:18 PM
tashirosgt Offline
Registered User
 
Join Date: Aug 2004
Posts: 3,855
linuxfirefox
Re: Command question

Quote:
Originally Posted by stevea View Post
Try the
man ls
command for more info.
And, Socrates440, it wouldn't be a real computer question if you could get a the answers simply by reading the documentation. The behavior of the "ls" command in a typical Linux distribution is often slightly changed by the fact that it is "aliased" to a slightly different command.

For example, on my FC 16, installation , I can use the command

Code:
alias
and get the output

Code:
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias vi='vim'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
This explains the color choices of the "ls" command on my machine - or I should say it doesn't explain them to me since I don't know what "auto" does or what configures that.

To get into the details of how aliasing of commands is done would be a digression. I just wanted to let you know that the behavior of a command may vary slightly from its "man" page.

...and after all, if anybody and his brother could figure out computers, what would be the point in messing with them?
__________________
"Never let the task you are trying to accomplish distract you from the study of computers."

Last edited by tashirosgt; 26th May 2012 at 04:28 PM.
Reply With Quote
  #5  
Old 26th May 2012, 04:47 PM
sdlor Offline
Registered User
 
Join Date: Mar 2008
Location: The Great Inland Northwest
Posts: 207
linuxchrome
Re: Command question

Try:
Code:
@localhost Downloads]$ ls -la
(to show the hidden files, also)
__________________
F17-PAE, 32 bit; GeForce GT 430
Reply With Quote
  #6  
Old 27th May 2012, 01:46 AM
Gareth Jones Offline
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,708
linuxfirefox
Re: Command question

Quote:
Originally Posted by tashirosgt View Post
This explains the color choices of the "ls" command on my machine - or I should say it doesn't explain them to me since I don't know what "auto" does or what configures that.
The "color=auto" option is to avoid terminal escape sequences (which change the colour of text in the terminal) from being written to files or pipes. ls checks to see if its output is a terminal or not. If its output is a terminal, colour terminal escape sequences are used, otherwise colour is not used and only plain text is output.
Reply With Quote
  #7  
Old 27th May 2012, 07:30 PM
Socrates440 Offline
Registered User
 
Join Date: May 2012
Location: Aspen
Posts: 48
linuxfirefox
Re: Command question

Thanks for all of the info everybody
Reply With Quote
  #8  
Old 28th May 2012, 12:38 PM
george_toolan Offline
Registered User
 
Join Date: Dec 2006
Posts: 1,718
linuxfirefox
Re: Command question

The next thing you're going to need is the pwd command ;-)

Quote:
pwd - print name of current/working directory
Reply With Quote
Reply

Tags
command, question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
a vi command question akaisora Using Fedora 13 23rd October 2010 11:40 AM
Question for yum command Totony Using Fedora 4 6th February 2010 04:19 PM
Question about mv command vonedaddy Using Fedora 7 19th January 2009 03:41 PM
question about ls command chud Linux Chat 1 20th December 2005 04:18 PM
Tar command question satimis Using Fedora 1 21st May 2005 11:44 AM


Current GMT-time: 12:22 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat