What is the difference between /* and */?

The difference between /* and */ in Unix/Linux command-line contexts is as follows:

  1. /*:

    • This pattern matches all files and directories in the root directory (/).
    • For example, running ls -l /* will list all items located directly under the root directory, such as /bin, /etc, /home, etc.
  2. */:

    • This pattern matches all directories in the current directory.
    • For example, running ls -l */ will list all directories in the directory you are currently in, showing detailed information about each one.

In summary:

  • /* targets everything in the root directory.
  • */ targets only directories in the current directory.

If you have further questions or need more examples, feel free to ask!

0 Comments

no data
Be the first to share your comment!