What are common command-line options?

097

Common command-line options in Linux vary by command, but many commands share similar options. Here are some frequently used options across various commands:

  1. -h or --help: Displays help information about the command.

    command --help
  2. -v or --verbose: Provides detailed output about what the command is doing.

    cp -v source.txt destination.txt
  3. -f or --force: Forces an action, often used to overwrite files without prompting.

    rm -f file.txt
  4. -i or --interactive: Prompts for confirmation before performing an action.

    rm -i file.txt
  5. -r or --recursive: Used with commands like cp and rm to operate on directories and their contents recursively.

    rm -r directory/
  6. -a or --archive: Preserves attributes and copies directories recursively (used with cp and tar).

    cp -a source/ destination/
  7. -n or --no-clobber: Prevents overwriting existing files.

    cp -n source.txt destination.txt
  8. -l or --list: Lists files or directories (used with commands like ls).

    ls -l

These options enhance the functionality of commands and allow for more control over their behavior. If you have specific commands in mind or need more details, feel free to ask!

0 Comments

no data
Be the first to share your comment!