Go Job Hunting at the LQ Job Marketplace
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-19-2004, 03:30 PM   #1
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Rep: Reputation: 30
newbie: how to see the size of file under bash?

hi, i "thought" by issuing: ls -s -h would allow me to see of size of the file in that directory.

but this morning, when i used the GUI interface, the file size i have in bash is diff then the one i got in GUI

for example, if i do: ls -s -h 400K myfile

under GUI, right click icon, Properties: 78MB

i must not fully understand what "man ls" meant when it gives option such as -h and -s

so how to see the size of the file using bash?

thank you
Old 05-19-2004, 03:35 PM   #2
Senior Member
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577

Rep: Reputation: 48
under GUI, right click icon, Properties: 78MB
LOL, this is the size of the directory itself........

dont' right click the Icon......go to directory it is in and right click the file
Old 05-19-2004, 07:15 PM   #3
Registered: Oct 2003
Location: Madison
Distribution: mdk 8.2, 9.0, 9.2, slack 9.1
Posts: 403

Original Poster
Rep: Reputation: 30
thank you, but if i wanna know the size of the directory in bash, what is the command?

say ls i have 2 folders in this directory: folder1 and folder2.

i'd like to see size of folder1 without cd into it, how can that be done in bash?

thank you for help....
Old 05-19-2004, 07:23 PM   #4
Registered: Feb 2004
Posts: 467

Rep: Reputation: 30
Use du

du -h /home/user1


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH : Total directory size xgreen Programming 7 03-04-2013 05:33 AM
when creating a *.iso file, how to make the file size smaller? minm Linux - Newbie 8 12-26-2004 09:58 PM
Urgent !!! monitoring directory size using bash juby Programming 4 07-22-2004 05:47 AM
file system size larger than fysical size:superblock or partition table corrupt klizon Linux - General 0 06-18-2004 04:18 PM
Changing Text Size/Terminal Width in Bash TastyWheat Linux - General 2 11-02-2003 11:24 PM

All times are GMT -5. The time now is 07:35 AM.

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