Linux simple common Commands--pure hand play (slowly accumulate)

Source: Internet
Author: User
Tags system log temporary file storage

How do I see whether the Linux system is 32-bit or 64-bit?

Can be viewed with the command "getconf long_bit",

If the returned result is 32, the description is 32 bits, and the result returned is 64, the description is 64 bits.

Linux commands
Command Options (Parameters) option value (value of parameter)
Command + (option) + Parameters

LS Lists all
Ls-l
Ls-h
Ls-a
CD go to
Cd.. to the upper directory
CD-to the working directory of the last command
CD ~ Back to home directory
CD/Home root directory
Pwd

Hwclock

Shutdown
Shutdown-h now shuts down the machine
Shutdown-r restart
Shutdown-c Cancel shutdown
Init 0 shutdown
Init 6 Restart
Reboot

Iptable-f This file empty

/boot stores files that need to be loaded when Linux starts

/Home Store directory for ordinary users

/var is an extensible directory such as/var/log System log/var/lib package file

/root Admin All data root user home directory

/tmp temporary file storage location

/usr Unix software soure package file storage software related

/bin command This directory contains a binary executable file

/sbin system commands are primarily intended for use by administrators for system maintenance

/MNT mount point Mount Image

/dev contains device files/dev/sda*

./relative Path/absolute path

. Represents the current directory: Indicates a parent directory

Touch is used to create a new file

mkdir creating catalogs such as Mkdir/tmp/test
Mkdir-p/a/b/c/d Creating a directory subdirectory

!$ last parameter of last command (shortcut key)

Ways to view files: Q exit
Cat viewing file contents such as CAT/ETC/PASSWD
More
Less
Head defaults from the first line starting at 10 rows such as Cat head-n 3/etc/passwd viewing files from the first line before starting 3 lines
Tail default last 10 rows
-F Dynamic Display data (not closed) often used to view logs

CTRL ^c Terminate command

Linux under Blue is the directory black is the file light blue is a soft connection, in the same directory: directory and file name can not be the same;

Copy file: CP copy a single file, there is no more directories and other files
CP Source Target
such as cp/etc/passwd/tmp/

Copy directory: Cp-r/etc//tmp/
-R is recursive means contains subdirectories and files

Delete RM
RM-RF Delete all (including directories and files) Force recursive deletion
-R recursive-F coercion

MV Rename
MV Source name New name

Work experience: Use RM Delete command with caution use the MV command to rename to replace the deleted effect

VI reduced version of VIM upgrade version
Edit
RPM-QF ' which VI ' get VI installation package
VIM command line mode
Character manipulation:
I currently insert
I line header insertion
A after the current character is inserted
A line end insertion
o Insert Next line
o Insert Previous line
X Remove one character backwards
X Delete one character forward
U undo one Step = = = "commonly used
Home Key Beginning
End Key Line End
DD Delete a row
YY Copy a row
P Paste the copied line
Force save exit with wq! when no permission
: W Saves Save
: Q did not make any changes to quit quit
: q! modified, not saved, forced to quit
: wq! force Save to exit (use this when you do not have permission)
: Set NU Displays line number


Comment on multiple lines of the configuration file:
CTRL + V
Select the line you want to comment up or down
Shift+i
On one line before the # sign
Press ESC

To delete multiple lines of comment:
Ctrl + V into edit mode
Move the cursor up or down and select the Notes section
Press D to delete the comment symbol

transcoding commands:
Iconv-f gb2312 C.txt-o D.txt
From output
Troubleshoot serial issues with server scripting on Windows because Windows and Linux handle carriage returns differently.

Automatically download something from the network to Linux
Wget...http: ....
wget +url
First CD to the directory you want to download and wget

Hit 3 characters Press the TAB key to automatically get the file name

======== Installation ========
One: Source code installation Method:
First CD to the directory you want to install

TAR-ZXVF File name Decompression
Decompression of the tar.gz
The first step:./configure check that the current environment is well-satisfied with the dependencies for installing this software
Can you use echo $ after you're done? If the result is 0, then OK, proceed to the next step;
Step Two: Make
Step Three: Makeinstall
Does the fuzzy query have a software installed:
Find/-name Pcre*|more

Two: Automatic installation Yum installation: Yum Install package
Example: Yum-y Install Pcer-devel

Three: Binary file installation: Rpm-ivh file.rpm
Suitable for installation of RPM installation packages

For decompression, see different decompression commands

= = Unload ============
sudo make uninstall (take out the file you want to get into by doing the install command to be an administrator)

Only temporary files generated when make is deleted (SOFT1):

Make clean

Delete temporary files from configure and make (SOFT1)

Make Distclean
=====================

Ps-a Show All Processes

Kill-quit main process number Stop a process

Linux simple common Commands--pure hand play (slowly accumulate)

Related Article

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.