(4) Linux Common Command Learning

Source: Internet
Author: User

Common Linux Commands basic formatcommand [options] [parameters]
Note: The individual commands used do not follow this format and can be written together when there are multiple options. Simplified and complete Options-A equals--all
[email protected] ~]#among them:Root: currently logged in userlocalhost: host name ~ current directory (home directory)# Super User's promptthe prompt for a normal user is $the Administrator account in Linux is root1, the contents of the query directory: LSls [options] [file or directory]Options:-A displays all files, including hidden files - L Show more information- D View Directory Properties- h humanized display file size-I display inode
Permission Explanation:
    • -rw-r--r--
      • - file type (-file d directory l soft link file)
      • rw-r--r--
u owner G-owned group O other person R Read W write x executeIi. Establishment of the catalogue: mkdir
    • mkdir-p [directory Name]
-P Recursive creation Command English willing:makedir ectories
third, the directory where you switch: CD
    • CD [catalogue]
command English Willing: Change directory
    • Simplify operations
CD ~ Enter the current user's home directoryCDCD-Go to last directoryCD.. Go to the top level directoryCD. Go to current directory  
    • Relative path: Search by reference to the current directory
such as: [[email protected] ~] # CD. /usr/local/src/
    • Absolute path: Specified from the root, recursive lookup at the first level. In any directory, access to the specified location
such as: [[email protected] ~]# cd/etc/

Tips: Ctrl+l Clear screen, tab can be used to complete the directory or command completionIv. the directory where the query is located: pwd
    • Pwd
Command English original meaning:printworkingdirectoryv. Delete empty directory: rmdir (deprecated)
    • rmdir [directory Name]
Command English original meaning:removeemptydir ectories vi. Deleting files or directories: RM (recommended)
    • RM-RF [file or directory]
Command English original meaning: remove Options:- R Delete directory- F Mandatory
vii. Copy command: CP
    • CP [Options] [Original file or directory] [target directory]
Command English original:coP y Options:- r Copy directory-P Joint file attribute copy -D If the source file is a linked file, copy the link property-A equals-pdr

Tip: Ls-l works the same as LL command
eight, cut or rename command: MV
    • MV [original file or directory] [target directory]
Command English original meaning:mov e
the role of the common directory
    • /root
    • /bin Command Save directory (commands that normal users can read)
    • /boot start directory, start related files
    • / Dev Device File save directory
    • /etc configuration File Save directory
    • /home home directory for ordinary users
    • /lib System Library Save directory
    • /mnt system mount directory
    • /media mount directory
    • /root Super User's home directory
    • /tmp temp directory
    • /sbin command to save directory (directory that superuser can use)
    • /proc write directly to memory
    • /sys
    • /USR system software Resource Directory
/usr/bin/System command (normal user) /usr/sbin/system command (super User)
    • /var system related document content


Link Command
    • ln-s [Original file] [target file]
    • Command English original meaning: link
    • Function Description: Generate link file
option:-S to create a soft link hard-Link features:1, have the same I node and storage block block, can be seen as the same file2, can be identified by the I node3. Cannot cross partition4. Cannot be used for directory
Soft Link Features:1, similar to Windows fast key mode2, the soft link has its own I node and block blocks, but the data block only save the original file name and I node number, and no actual file data3, lrwxrwxrwx l Soft linkSoft Link file permissions are rwxrwxrwx4, modify any file, the other one has changed5, delete the original file, soft links can not be used

(4) Linux Common Command Learning

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.