LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-09-2011, 06:24 AM   #1
evansd321
LQ Newbie
 
Registered: Aug 2008
Posts: 24

Rep: Reputation: 0
Show file size in MB not bytes


Hi all,

In BASH, when I do "ls -l" all the files sizes are listed in bytes, is there a command that would show me file sizes in MB?

Thanks
 
Old 08-09-2011, 06:27 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

Try:
Code:
ls -lh
Read the man page for more information.
Code:
man ls
Kind regards,

Eric
 
Old 08-09-2011, 06:34 AM   #3
blingham
LQ Newbie
 
Registered: Jul 2009
Location: Canada
Distribution: Mint, Fedora, Ubuntu Server
Posts: 28

Rep: Reputation: 3
I agree with EricTRA. The added h stands for human readable (MB and GB vs Bytes).

Jay
 
Old 08-09-2011, 08:47 AM   #4
MTK358
LQ 5k Club
 
Registered: Sep 2009
Posts: 6,443
Blog Entries: 3

Rep: Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723Reputation: 723
Quote:
Originally Posted by evansd321 View Post
In BASH
ls doesn't have anything to do with bash, it's just an independent program.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] the file at your target is 0 bytes in size need_help_linuxmint9 Programming 6 03-18-2011 11:27 PM
does logrotate set size to 1048576 bytes by default if no size is specified? finebanana Red Hat 0 01-22-2009 12:10 AM
Samba Folder does not show proper file size in windows Rustylinux Linux - Server 1 08-30-2007 10:18 AM
Function that returns the size of a file in bytes in C kalamaraki Programming 2 01-07-2007 11:22 AM
Trying to show only certain lines over a certain size in a file branall1 Linux - Software 2 11-15-2005 03:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:18 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