Check whether a Directory is empty or not

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

  1. The problem statement, all variables and given/known data:
    1.pls tell me the command for checking whether a given directory is empty or not .
  2. can i check what is the last copied item in a directory .
    and i yes , i want to move that last copied item in another directory .

pls help me with shell code for these two tasks

thanks

  1. Relevant commands, code, scripts, algorithms:

ls -l displays it on terminal

  1. The attempts at a solution (include all code and scripts):

ls - l does it , but i dont know how to use it for getting last entry

  1. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

its a part of research on analysing executables.
professor M.S. gaur
MNIT jaipur

Maybe it is just me, but i sense a misconception about how Unix commands work.

In fact not ls -l does it, but ls does it. "ls" is a command and it shows a directories contents. How it does this can be widely influenced by using certain options.

You already saw the "-l" option at work, which changes the display format from the default short (only filenames) to a long (filemode, owner, group, etc.) listing.

Now, here is a general rule for working with Unix: nobody knows ALL the options every command has - not a single person! This is what "man" pages are for, which you invoke by

man <command>

Think of these as like a telephone directory: you don't have to know all the numbers by heart, you just have to know the name and the city. In Unix you have to know that "ls" shows directories contents and to find out how you manage to get some specific listing of these contents you look up the man page if you can find something which suits your purpose.

So i suggest you try that and report back here. If you find anything worthwile we will take it from there.

I hope this helps.

bakunin