Get the App
SLTechnology News&Howtos  ›  Servers  › 

What are the common commands of mac

Shulou Source: shulou.com Published: 2022-06-01 02:58:11 09月29日 Update

This article mainly introduces what are the common commands of mac. It is very detailed and has a certain reference value. Friends who are interested must finish reading it!

Create a folder

Mkdir folder name

Create a folder

Mkdir test

Create a file

Mkdir a.txt

Write content in the created file

Echo 'Hello Word' > a.txt

Edit the contents of the file

Vi file name (enter into the file)

Press I (enter edit mode)

Press esc to exit edit mode

Press: wq (Save edits and exit)

Press: Q! (exit without saving content)

View the contents of the file

For example: cat a.txt (cat is used to view files with less content)

For example: more a.txt (more is used to view files with more pages, press the space to realize the next page)

If the contents of the file are misspelled, there are two steps to correct them

1. Want to create a file with correct spelling

Echo 'Hello World' > newfil.txt

Echo 'Hello World' > newfile.txt

two。 Use the mv command to replace the misspelled file with the new file "mv old file new file"

Mv newfil.txt newfile.txt (actually overwrites the first file completely to the second file, and the first file disappears)

Permanent deletion

Rm-rf file name

Check what files are in the directory

Ls-lh

Show current directory path

Pwd

Clear the content displayed by the terminal

Clear

Wc counts the number of characters, words and lines of the file wc filename

Java-jar C:\ FireLine\ fireline.jar-soundC:\ Users\ Administrator\ Desktop\ doctor-ritual C:\ FireLineReport

The above is all the contents of the article "what are the common mac commands?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Files contents commands folders common file names patterns directories articles errors under two values interests characters actually guys buddies more Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info MySQL Apple macOS Shulou Information