linux-Common directives

Source: Internet
Author: User

Linux Common commands

Learn about the command of Linux Learning, I believe no one came up to embrace the Linux command Encyclopedia to see it! So many orders to beat you. And not good memories, easy to forget. My method is to use what to remember. It's not going to be a lot of work, so it's natural to remember.

Tip : I don't know how many people have used a small tool like Youdao notes, and you can save some of the commands you use frequently to your notes, and which one you use when you're working. Don't try to remember.

The following list lists the commands that are known to the novice:

Switch between folders

ls     Displays all files and folders in the current directory   
CD /USER Open the user folder
If you do not know the full name or length of the folder you want to open, you can press the tab keyboard to automatically complement it, such as: CD
CD.. (The trailing space plus two points) returns to the top level directory

Super simple, remember the above several in the folder between the jumping around has no problem.

Operation of the file

Create
mkdir  Test    Create Folder
Touch Test.txt Creating a file
Edit
VITest.txt Open Test.txt File

CPress the C key on the keyboard to switch from read-only to edit state
ESCSwitch from edit state to read-only state
: Qis exit (when the file has not changed)
: q!Do not save the exit (when the file changes)
: WqSave and exit

Copy
CPTest.txt test2.txt test.txt file under the current folder to copy a test2.txt

CPTest.txt/hzh/test Copy the Test.txt to the/hzh/test directory

Delete
rm aa.txt Delete aa.txt file
rm -r bb Delete bb directory (including all files under directory)

Move
MV Dd.txt. Move the Dd.txt file to the top-level directory (note the two points at the tail)
MV bb.txt/hzh/test/Move the Bb.txt file to the hzh/test/directory

Renamed
MV Dd.txt Dd2.txt renamed Dd.txt to Dd2.txt

Find
Locate aa.txt Check the Aa.txt file in the entire system, locate\slocate the command followed by the file or folder. However, to update the database before executing this command, choose the Execute updatedb command.

What do you think?! Just remember some of the above commands, congratulations! You have been the file and folder of the increase, deletion, change, check, moved.

View System Information commands

DF-LH  View disk Information

lsb_release-a View all version information for the system

Free View memory Information
             Total       used       free     shared    buffers     Cached
Mem: 1034536 294568 739968 0 15636 174944
-/+ Buffers/cache: 103988 930548
Swap: 1052248 0 1052248
Here is an explanation of these values:
   Total: Total physical memory size.
used : How much has been used.
free : How many are available.
shared : Total memory shared by multiple processes.
buffers/cached : The size of the disk cache.
Third row (-/+ buffers/cached):
Used: How much has been used.
free : How many are available. The fourth line of the
is not much explained. &NBSP


PS View the currently running process
Kill -9 QQ.exe terminate the process, 9 means the forced process stops immediately

Shutdown command

shutdown now  Shut down now.
shutdown +5 Shut down after 5 minutes.
shutdown 23:10 Set the system to shut down at 23:10
Shutdown-r now Shut down the system and reboot now


The concept of piping:
connect the front output with the following input

For example, I have to undress before I go to bed. I can do it in two orders, 1. Undressing 2. Go to bed. But through the pipeline, I can write two steps together: Undress | Go to bed. Of course I can also write three or four steps (commands) together, but the previous command must be a precondition for the latter command. As I've given the example, I can't go to bed and undress.

Cases:
# Ls-l | More-l display so results, "|" Connection, more for split screen display

How many Linux commands Ah, not to finish, if you like to understand the use of a command can be followed by a command--help view parameters. My point of view is to use which Google which, and then record to the notebook convenient later check.

linux-Common directives

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.