Some of the common Linux commands and usages that I have come into contact with (beginner caught dead) are updated daily ....

Source: Internet
Author: User

Command function

Shutdown-h now shutdown command

StartX into the graphical interface (if your redhat has a desktop installed), X is the X-window desktop

Shutdown-r now reboot (or use reboot)


VI Editor use (in fact, VI is very powerful, shortcut keys are also many, here only to say some of the Common VI command)

VI Helloworld.java Create a Helloworld.java file and open it with VI

Press I (insert mode) to start writing code, after the code is complete, press ESC to exit (Command mode) from (insert mode);

Input: Wq Enter save file, input q! Exit does not save the file.


Edit C language HelloWorld.cpp with VI

GCC HelloWorld.cpp compiles C programs, generates a.out files, runs a.out files (commands./a.out)

Gcc-o AA hello.cpp (compile hello.cpp files with this command, generate aa.out files to avoid developing multiple program overrides)


PWD Displays the directory where you are currently

Useradd itcast Add a user named Itcast

passwd Itcast Enter two times 123456 set password for itcast user

Userdel itcast Delete itcast this user

Userdel-r itcast Delete itcast This user and user directory under/home


Specify the Run level:

A total of 7 levels: Init 0-7

0: Shutdown (user power off immediately, not recommended)

1: Single-user mode

2: Multi-user status No NETWORK service

3: Network Service with multi-user status (server common)

4: System not used reserved to user

5: Graphical interface (common for personal desktop users)

6: System reboot (unlimited reboot on boot, not recommended)

How to modify: Modify with VI editor

Vi/etc/inittab find the Id:5:initdefault inside: (Numbers can be 3 and 5): Wq Save and exit

If the configuration error is 0 or 6, you can enter E (GRUB) when booting into the boot interface, select kernel, press E, enter the editing interface, enter 1 (single user mode) carriage return, press B, restart into single user mode, you can use the VI editor to open

Vi/etc/inittab Enter, modified to (3 or 5), with: Wq save, restart reboot can.


LS lists the files and directories in the current directory

LS-A displays all files (including hidden files) that the current directory wants

Ls-l display the current directory file and directory (long list format) General Blue is the directory name

mkdir AA Create a new directory named AA (AA arbitrary fetch)

RmDir AA Deletes a directory named AA (AA is an empty directory)

Touch to create an empty file

CP Replication (example: CP hello.cpp/home/itcast copy files to the following path)

Cp-r dir1 dir2 Recursive copy command (copy subdirectory information)

MV Remove files or change file names

RM * Delete files and empty directories

rm-f * Force Delete * file (not prompted)

RM-RF * Delete all content in * (Files and directories) R for recursion, F for force



Daily updates ...







This article is from the "Devin Towne" blog, be sure to keep this source http://tangwan.blog.51cto.com/7098506/1597955

Some of the common Linux commands and usages that I have come into contact with (beginner caught dead) are updated daily ....

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.