Common MAC Commands

Source: Internet
Author: User

Create a folder

mkdir folder name


Create a folder

mkdir test


Create a file

mkdir a.txt


Write the content in the created file

Echo ' Hello Word ' > A.txt


Edit File Contents

VI File name (enter the file)

Press I (enter edit mode)

Press ESC to exit edit mode

Press: Wq (save edits and exit)

Press: q! (Exit does not save content)


View File Contents

Example: Cat A.txt (cat to view files with less content)

For example: More a.txt (more for viewing more pages of files, press space can be realistic next page)


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

1. Want to create a correctly spelled file

Echo ' Hello world ' > Newfil.txt

Echo ' Hello world ' > Newfile.txt

2. Use the MV (move) command to replace the misspelled file with a new file "MV Old File New file"

MV Newfil.txt Newfile.txt (the first file is actually completely overwritten to the second file, the first one disappears)



Permanently delete

RM-RF file name


See what files are in the directory

Ls-lh


Show current directory path

Pwd


Clear what the terminal displays

Clear


Number of characters, number of words, and number of lines in WC statistics file WC filename


Java-jar C:\fireline\fireline.jar-s=c:\users\administrator\desktop\doctor-r=c:\firelinereport


This article from the "32 Krypton" blog, reproduced please contact the author!

Common MAC Commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.