LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   newbie: how to see the size of file under bash? (http://www.linuxquestions.org/questions/linux-newbie-8/newbie-how-to-see-the-size-of-file-under-bash-183406/)

sirpelidor 05-19-2004 03:30 PM

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

320mb 05-19-2004 03:35 PM

Quote:

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

sirpelidor 05-19-2004 07:15 PM

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....

comp12345 05-19-2004 07:23 PM

Use du

Example
Code:

du -h /home/user1


All times are GMT -5. The time now is 07:11 PM.