hi umar!
That's an interesting question, since there does not seem to be a "built-in" command for this purpose in Linux.
Achieving this goal should not be a big problem, I suppose, supported you read the man pages carefully and write a script of your own
Or try to find out such a script on the net. I have a feeling that there must be people aroung having written such a script. The question is only how and where to find their scripts.
Good luck,