Basic Linux commands and Linux commands

Source: Internet
Author: User

Basic Linux commands and Linux commands

[Epeter @ localhost ~] $

Where: epeter is the user name; localhost is the current host name ;~ The broken wave number indicates that the current user directory is used (If yes, the slash indicates that the current root directory is used ); $ indicates that you are currently logged on as a normal user (If yes, # indicates that you are currently logged on as a root user (root user or administrator privilege )).

A command consists of three parts: Command, option, and parameter.

Switch users:

Switch su epeter to epeter user

Switch su-epeter to epeter user

The difference between addition and addition is that addition enables a completely new terminal environment (shell environment.

 

Hostname display Host Name

Username current user name

Uanme-r kernel version

The Tab auto-completion command is used to automatically complete the file name. The parameter cannot be automatically completed.

Cd file name open this file

Cd ~ Open user directory

Cd/open the root directory

Ls

Ls-l view the file details in the directory

Ls-a indicates displaying hidden files

Ls-d directory attributes

Same as ls-ld

Ls/root user's home directory

Main directory of the user in the ls/home Directory

Ls/dev/System Device File

Mkdir tmp create the 'tmp 'directory

Mkdir-p tmp01/test recursively creates the 'tmp01' directory, while the 'test' directory is created under the 'tmp01' directory.

Touch test.txt creates the 'test.txt 'file

Touch "progam files" creates a file named 'progam files 'with spaces, and adds double quotation marks

Rm "progam files" delete 'progam files 'files with spaces, with double quotation marks

Rmdir delete an empty directory

Rm tmp Delete the 'tmp 'directory

Rm-r tmp: Delete the 'tmp 'directory and directories under the directory, and delete them cyclically.

Rm-f text.txt forcibly Delete the 'text.txt 'file

Rm-rf text.txt forcibly deletes the directory. (Use with caution)

Cp/root/test.txt test/copy the 'test.txt 'file to the 'test' directory.

Cp-r/root/tmp tmp01/copy the 'tmp 'directory to the 'tmp01' directory.

Mv test.txt test01 cut the 'test.txt' file to 'test01', and the location of 'test.txt 'is changed.

Mv test.txt epeter rename 'test.txt' as 'epeter.txt'

 

 

// To be supplemented...

 

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.