Linux Command Learning

Source: Internet
Author: User

Memory Directory
/dev/shm

View memory, CPU usage
Top

View disk usage
Df-l
Df-h

Directory Jump
Go to CD
Go back to the previous layer of CD ...
Return to root CD/

Clear Screen
Clear

Common directories
/
root directory.
/boot
Directories such as boot programs, kernels, and so on.
/sbin
The host directory of commands that the superuser can use.
/bin
The directory in which commands can be used by ordinary users.
/lib
The shared library directory of the program under the root directory.
/dev
Device Files directory.
/home
Directory for normal users ($HOME directory)
/root
$home Directory for user root
/etc
The global configuration file holds the directory.
/usr
This directory contains the command library files and files that are not modified in the usual operation.
/proc
Special Files directory.
/opt
Optional file directory.
/mnt
Temporary mount directory.
/media
Mount the media device directory.
/var
A directory in which content changes frequently.
/tmp
Temp file directory.
/lost+found
The location where the files are recovered.

Usually put in the home folder OK. Other folders/dev device special files
/etc system administration and configuration files/tmp Common temporary file storage points
/root system administrator's home directory/MNT system provides this directory is to allow users to temporarily mount other file systems
/var overflow area for some large files, such as log files for various services
/usr The largest directory, the applications and files to be used in almost all of this directory
So, temporary put on TMP good, permanently put in home, put in other folders is a little messy

Root Home tag
[[Email protected] ~]

Root/Tag
[[email protected]/]

File, folder operation RmDir
-R is recursive down, no matter how many levels of directory, delete
-F is directly forcibly deleted, without any hint of meaning
Create folder MkDir folder
Create a file touch file. txt
Delete folder RmDir folder to empty, non-empty error
Delete Folder Rm-rf
deleting files Rm-f
Directory move, rename MV [source] [destination]

Linux plus unzip
. gz
Decompression 1:gunzip filename.gz
Decompression 2:gzip-d filename.gz
Compression: gzip FileName

Text editing
Enter Vi/etc/profile
Exit Press ESC First, and then enter: Wq

VI Editor Edit or view text
VI aa.txt input I (or c) for insert command, ESC and then enter Colon:, and then enter: Wq Save exit
C Press the C key on the keyboard to switch from the read-only state to the edit state
ESC switches from edit state to read-only state
: Q is exited (when the file has not changed)
: q! Do not save the exit (when the file changes)
: Wq Save and Rewind
The quickest way: After pressing ESC, press SHIFT+ZZ directly, or switch to uppercase mode by ZZ, you can save the exit, that is, by 2 uppercase Z.


Service-related
Service mysqld Start
Service Mysqld Stop
Restart Service mysqld Restart


Boot up
Chkconfig mysqld on

Linux 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.