How would you find the size of a file or directory?



How would you find the size of a file or directory?..

Answer / hr@tgksolutions.com

The du command, standing for "disk usage", can be employed to ascertain the size of files and directories. du -sh filename would display the size of a file, while du -sh directory_name reveals the total size of a directory. The -s provides a summary and -h displays sizes in a human-readable format (like KB, MB). It's an invaluable command for monitoring space utilisation and managing storage effectively.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Unix Commands Interview Questions

what are wild cards?

2 Answers  


What are some command words?

1 Answers  


What is the significance of the 'tee' command?

1 Answers  


How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazement in some of the line.But i want to replace only 'amaze' with delight but don't wanna replace amazed or amazement. thanks

6 Answers   Polaris, Tech Mahindra,


How are UNIX file permissions represented?

1 Answers  


what will be the output of ls ~/..

27 Answers   ABC,


What are the unix commands?

1 Answers  


what is shell?

5 Answers  


Write a command that will find all text files in a directory such that it does not contain the word "amazing" in any form (that is, it must include the words amazing, amazing, or amazing)?

1 Answers  


What is grep and how do you use it?

1 Answers  


Is ‘du’ a command? If so, what is its use?

1 Answers  


What is $0 bash?

1 Answers  


Categories