Linux notes (medium)

Source: Internet
Author: User

 

Some common basic commands:

Uname-a view kernel version

Ls-AL: Display Properties of all files

PWD displays the current path

CD-returns the last directory Cd ~ Returns the home directory.

Date S: set the time and date

Cal display calendar Cal 2006

BC Calculator

Man & info help manual

Locale displays all available fonts locale-A in the current font/etc/sysconfig/i18n setting file

Lang = en english font

Sync writes data synchronously to the hard disk

Shutdonw-H now & Half & poweroff Shutdown

Reboot restart

Startx & init 5 enters the graphic interface

/Work &? Work: Search for document content up and down

Chgrp changed the archive group chgrp testing install. Log

Chown changed its owner chown root: Root install. Log

Chmod change attribute chmod 777 install. Log READ = 4 Write = 2 execute = 1

CP copy CP filename

Rm delete file Rm-RF filename force delete file

Rmdir Delete folder

Rename MV 123.txt 222.txt

Create a folder using mkdir

Touch file creation update current time

Cat displays cat from the first line | more pages

NL adds a row number before the content

More & less side flip

Head-N filename: displays row N content

Tail-N filename: The last n rows of content displayed

Od display non-pure document

DF-H display partition Space

Du: displays the directory or file size.

Fdisk partition settings fdisk-L/dev/hda display hard disk partition status

Mkfs creates various file systems mkfs-T ext3/dev/ram15

Fsck checks and fixes Linux Files

Ln hard link ln-S software Link

Whereis SEARCH Command

Locate search

Find find/-name "***.***"

Which viewing tool

Whoami displays the current user

Gcc-V view GCC version

Delete chattr-I filename cancel prohibition

Lsattr show hidden attributes

Updatedb updates the database

Mke2fs format mkfs-T ext3

Dd If =/etc/passwd of =/tmp/passwd. Bak backup

Mount: list all partitions in the system.

Mount-T iso9660/dev/CDROM/mnt/CDROM mounting Disc

Mount-T vfat/dev/fd0/mnt/Floppy mount a floppy disk

Mount-T vfat-O iocharset = utf8, umask = 000/dev/hda2/mnt/hda2 mount the FAT32 Partition

Mount-t ntfs-o nls = utf8, umask = 000/dev/hda3/mnt/hda3 Mount NTFS partitions

Linux-NTFS project: http://linux-ntfs.sourceforge.net/

Umount/mnt/hda3 volume

Ifconfig displays or sets network devices

Service Network restart Nic

Ifdown eth0 disable Nic

IFUP eth0 enable Nic

Clear Screen

History history! 55. Execute 55th commands

Stty terminal stty-

Fdisk/MBR Delete grub

At

Crontab: routinely executed command [e] edit, [l] display, [R] Delete task

& Background running program tar-zxvf 123.tar.gz & ---------> background running

View jobs in the background

FG transfers the background program to the foreground FG n ------> N is a number, you can specify the program

BG enables the work to run in the background

Kill End Process kill-9 PID [9] force end, [15] Normal end, [l] list available kill Signals

PS aux viewing background programs

Top view background programs top-D 2 update every two seconds top-D 2-p10604 watch a PID

Top-B-N 2>/tmp/top.txt -----> perform the top information twice and output the result to/tmp/top.txt.

Pstree uses the tree chart to display the program [a] connected with ASCII, [u] listing PID, [p] listing account

Killall to delete a service killall-9 httpd

Free Display memory status free-M --------> displayed in MB

Uptime displays the current system boot time

Netstat displays the network status netstat-tulnp ------> Find the network that is currently being monitored online and Its PID

Dmesg displays the boot information demsg | more

Nice sets priority nice-n-5 VI & -----> use root to give a nice implant as-5 for executing vi

Renice adjusted priority

Runlevel displays the current runlevel

Depmod

Lsmod displays the modules loaded into the system

Modinfo displays information about the kernel module

Insmod loading Module

Modprobe automatically processes the load-able Module

Rmmod Delete Module

Check chkconfig and set various system services chkconfig -- list -----> to list various service statuses.

Ntsysv sets various services of the system

Cpio backup file

Compression command:

*. Z files compressed by the compress program;

*. Bz2 Bzip2 compressed files;

*. Files compressed by the GZ gzip program;

* The data packaged by the. Tar program has not been compressed;

* .Tar.gz tar package files, which are compressed by Gzip

Compress filename compressed file plus [-D] uncompress

Gzip filename compression plus [-D] decompress zcat 123.gz to view the compressed file content

Bzip2-Z filename compression plus [-D] unzip bzcat filename.bz2 to view the compressed file content

Tar-CVF/home/123.tar/etc package without compression

Tar-xvf 123.tar unpacks

Tar-zxvf/home/123.tar.gz unzip with Gzip

Extract tar-jxvf/home/123.tar.bz2 with Bzip2

Tar-ztvf/tmp/etc.tar.gz view tar content

Cpio-covb> parts

Cpio-icduv <Restoration

Common VI usage

General mode edit mode command mode

H left a, I, R, O, A, I, R, O: W save

Enter edit mode under J: W! Force save

On K, DD deletes the current row of the cursor: Q! Do not save and exit

L right NDD Delete n rows: WQ! Save and exit

0 move to the beginning of the row YY copy the current row: E! Restore original file

$ Copy n rows to the end of the row: W filename save

H. paste P and P at the top of the screen: Set nu to set the row number.

M screen center U undo: Set Nonu cancel row number

L click [CTRL] + R at the bottom of the screen to redo the last action ZZ and save and exit.

The last line of the G file [CTRL] + Z is paused and exited: Set nohlsearch permanently disables the highlighted display

/Work downward search: SP opens two documents at the same time

? Work: Search [CTRL] + W for two documents

Move Gg to the first row of the file: nohlsearch temporarily disables highlight
 

 

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.