Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Use Terminal on macOS: A Comprehensive Guide

The Command Prompt, commonly referred to as CMD, is a command-line interpreter application available in most Windows operating systems. It is used to execute entered commands and perform advanced administrative functions. However, in the Apple environment, the equivalent tool is the Terminal application, which provides access to the Unix shell—a powerful interface for managing the macOS operating system.


Understanding how to use Terminal is crucial for macOS users who want to perform tasks more efficiently, automate workflows, or manage system configurations that are not easily accessible through the graphical user interface (GUI). This article will guide you through the basics of using Terminal on macOS, providing practical examples and commands to help you get started.


Examples:


1. Opening Terminal:



  • Open Finder.

  • Navigate to Applications > Utilities.

  • Double-click on Terminal.


2. Basic Navigation Commands:



  • pwd (Print Working Directory): Shows the current directory path.
     pwd

  • ls (List): Lists files and directories in the current directory.
     ls

  • cd (Change Directory): Changes the current directory.
     cd /path/to/directory


3. File Management:



  • touch: Creates a new empty file.
     touch newfile.txt

  • cp (Copy): Copies files or directories.
     cp sourcefile.txt destinationfile.txt

  • mv (Move): Moves or renames files or directories.
     mv oldname.txt newname.txt

  • rm (Remove): Deletes files.
     rm filename.txt

  • rmdir (Remove Directory): Deletes an empty directory.
     rmdir directoryname


4. System Information:



  • top: Displays active processes.
     top

  • df: Shows disk usage.
     df -h

  • ifconfig: Displays network configuration.
     ifconfig


5. Permissions Management:



  • chmod (Change Mode): Changes file permissions.
     chmod 755 script.sh

  • chown (Change Owner): Changes file owner.
     sudo chown newowner filename.txt


To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.