Some common command lines under Mac

Source: Internet
Author: User
Tags parent directory

Count the simple commands that you will use in your work to strengthen your memory

  1. LS View the files under the current terminal directory
    1. Ls-a "Ls-a" will appear some file names with. xxxx, listing all content, including hidden files and directories
    2. LS-L lists all of the contents of the long-form directory, as follows. Space-sensitive
      1. Access rights. These are the operations allowed in a file or directory.
      2. The number of hard links. This number calculates the number of subdirectories and files. This number includes the parent directory link ( .. ) and the current directory link ( . ).
      3. User name of the file owner
      4. The name of the group that owns the file
      5. The size, in bytes, of the file.
      6. Date and time when the file was last modified.
      7. The name of the file or directory.
    3. LS-T order files and directories before the last modification.
    4. Ls-alt This seed command can be put together output, such as '-alt ' will output A and L and t all
  2. PWD to see where the current terminal directory is located
  3. CD entry to a folder such as: CD index
    1. Use the following
    2. CD Index Enter the index folder below the current directory
    3. Cd.. .. is to forget to go up a layer of folders if you need to walk multiple please use something similar to this: /.. /
  4. Medir Create a folder such as: Medir Index2
  5. Touch creates a file such as: Touch Index.txt
  6. CP copy files to another folder such as: CP index/text.html html/Copy the text.html below the index directory into the HTML folder
    1. CP index/text.html index/text2.html html/If you want to copy multiple spaces separated by
    2. CP index/t*.html html/* (wildcard) stands for all meanings, this line copies all HTML files under the index directory that begin with T
  7. MV ' CP ' is a copy of the file, MV is the same way to transfer files, such as: MV index/text.html html/Transfer the text.html file in the index directory into HTML
  8. RM Delete files such as: RM index.html
    1. Rm-r Index RM is to delete a file that does not contain a folder, if you need to delete the folder input rm-r xxxx will delete all files in the folder
  9. echo input, such as: echo "Hello World"
    1. echo "Hello World" > Hello.txt Create a txt format text whose content is ' Hello World ', want to learn more about the keyword "redirect" You can Search
  10. Cat output content, such as: Cat Hello.txt
    1. Cat Hello.txt > world.txt the contents of hello inside the world.txt, output cat world.txt to view
    2. Cat Hello.txt >> world.txt Append the contents of hello to the back of World.txt

Some common command lines under Mac

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.