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

How do I clear my terminal history?

0 Answers  


How to get a particular string as your prompt ? Give syntax of that command?

3 Answers  


What is the behavioural difference between cmp and diff commands?

0 Answers  


What does the command ' $who | sort –logfile > newfile' do?

0 Answers  


How can you copy files or directories?

1 Answers  


What is a shell in Unix? Name some common Unix shells.

2 Answers  


How do you execute a UNIX command in the background?

6 Answers  


What is use of sed command?

12 Answers   BitWise, Infosys, Reliance,


How to setup Disk space as well as memory in solaris10?

4 Answers  


What is rmdir command?

0 Answers  


Are you in or at the office?

0 Answers  


what is the use of ls -l command & what is the information it gives about user ?

5 Answers  


Categories