MacOS Terminal Commands You Should Remember – ByteSavvy

MacOS Terminal Commands You Should Remember

The following is a list of some commonly used MacOS terminal commands:

  1. ls: List the files and subdirectories in the current directory.
  2. cd: Changes the current directory. For example, cd Documents changes the current directory to the “Documents” folder.
  3. mkdir: Creates a new directory. For example, mkdir NewFolder will create a new directory named “NewFolder”.
  4. rm: Deletes a file or directory. For example, rm file.txt will delete the file named “file.txt”.
  5. cp: Copies a file or directory. For example, cp file1.txt file2.txt will copy the file named “file1.txt” and name it “file2.txt.
  6. mv: Moves a file or directory, or moves a file from one directory to another. For example, mv file.txt Documents will move the file named “file.txt” to the “Documents” directory.
  7. cat: Displays the contents of a file. For example, cat file.txt will display the contents of the file named “file.txt”.
  8. touch: Creates a new file or updates the timestamp of an existing file. For example, touch newfile.txt will create a new file named “newfile.txt.
  9. open: opens a file or application. For example, open file.txt will open a file named “file.txt” using the default application.
  10. pwd: displays the path to the current working directory. 11. top: displays the path to the currently running directory.
  11. top: displays the currently running processes and system resource usage. 12. ifconfig: displays the network settings.
  12. ifconfig: displays configuration information for the network interface. 13. ping: tests a connection with another network interface.
  13. ping: Tests a connection to another computer. For example, ping www.example.com will test the connection to “www.example.com”.
  14. ssh: Connects to a remote computer via the SSH protocol. For example, ssh username@hostname will connect to the specified remote computer using the SSH protocol.
  15. sudo: Execute commands with administrator privileges. For example, sudo rm file.txt will delete a file named “file.txt” with administrator privileges.
  16. diskutil: Manages disks and volumes. For example, diskutil list will display a list of disks and volumes on your computer.
  17. defaults: Manages default settings for systems and applications. For example, defaults write com.apple.Finder AppleShowAllFiles true will show hidden files in the Finder.
  18. say: Converts text to speech. For example, say “Hello, how are you?” will speak the text in voice.

These are some common macOS terminal commands that can help you with tasks such as file and directory management, system configuration, network operations, and so on. Please note that some commands may require administrator privileges to execute. You can get more detailed descriptions and usage of the commands by typing the command name followed by the “-h” or “–help” option in Terminal.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *