Linux directory Structure and basics

Source: Internet
Author: User

Directory structure:

/bin: Common command programs for storage systems

/boot: Some of the files required by the system to boot or boot

/dev: Available device files

/etc: System configuration-related things

/home: Master directory for all users

/LIB,LIB64: Storing the system's library files

/media: Plug and Play device files

/MNT: Storage Device Mount Directory

/OPT: Optional Package installation directory

/proc: The directory itself is a virtual machine system, recording process, network information, etc.

/root: Admin Home Directory

/sbin: Important System Execution files

/sys: Virtual file system, recording kernel data

/usr: User's available Programs directory

/var: file generated by system operation

Linux Common commands:

LS displays all files in the current directory

Ls-l displaying file and directory details

Ls-a Show all files including hidden files

CD XX Open xx folder

    • Create

mkdir xxx Create xxx folder

Touch Text.txt Create a file

    • Edit

VI test.txt Open test.txt file

C Switch to edit state

ESC switches from edit state to read-only state

: Q exit

: q! Do not save exit

: Wq Save and exit

    • Copy

CP Test.txt Test2.txt Copying files

CP test.txt/xxx/test.txt or/xxx/test Copy to a directory

    • Delete

RM test.txt Delete test.txt file

Rm-r xx Delete xx folder

    • Move

MV Text.txt. Mobile Text.txt

MV test.txt/xxx/mobile test.txt to xxx directory

MV Test.txt Test2.txt move to a place and rename

    • Find

Locate Text.txt find Test.txt file, updatedb Update database available

Find/-name file1 start searching for files from the '/' directory

PS View current Running process

Kill Qq.exe Process

Netstat-ano | findstr "5037" Lookup port occupancy

PWD Display work path

Shutdown now immediately shuts down the machine

Shutdown +5 5 minutes after shutdown

Shutdown-r now restart the system immediately

Reboot restart

Logout logoff

    • View File Contents

Cat file views The file contents from the first byte forward

TAC file Reverse view file contents from last byte

More files view a long file content

Less file is similar to more file, but can be viewed in reverse

Head-2 file to view the first two lines of a document

Tail-2 file to view the last two lines of a document

Tail-f file Real-time view of content that is added to a file

    • Disk space

DF-LH Viewing disk information

Free View memory Information

Ls-isr |more sorting files and directories in size

Du-sh DIR calculates the disk space occupied by dir

Command +--help View command use method

Reference articles are as follows:

Http://www.php100.com/html/webkaifa/Linux/2009/1106/3485.html

Http://www.cnblogs.com/knowledgesea/p/6146303.html

Http://www.cnblogs.com/fnng/archive/2012/02/21/2362013.html

Linux directory Structure and basics

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.