Need help in finding filesize , moving file , gzipping file

Hi ,

Please help with the following questions

1) how can i find size of a file ? i have written du -k $flname > s1 . Is this right ?
Any other better suggeastions ?

2) how do I use mv command for moving the file ? I need the syntax with some examples

3) Command for printing the total number of files and folders in the gzipped file .

4) How can I compress a folder using gzip ? when I tried it gave me an error saying gzip can't zip a folder

5) how can I keep the original file after gzipping , as you know gzip usually deletes the original file after gZipping

6) I want to gzip even the fies inside the subfolders of my file , sowhich command should I use ? Will gzip -r $filename do it ?

Thanks for answering .:slight_smile:

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.