Organize common Linux operating commands

Source: Internet
Author: User
  • Find the file: Find/-name htt. conf-print locate (first updatedb) which
  • Show file content more less head tail cat PG (pagination) Cat
  • File merging: CAT file 1 file 2> output file
  • Search for the grep [Option] string file list
  • Sort file content sort
  • Compare file content comm (sort the ordered files)
  • Diff-B ignore space-B ignore empty rows-I ignore case results: <first File> Second file
  • Show Calendar Cal 12 2007
  • Print LPR lp
  • Directory operation:. indicates the current directory. parent directory
  • Create directory mkdir copy CP-r Delete Rm-R or rmdir (-RF is not empty)
  • Switch directory CD Program/return user main directory CD current directory pwd
  • Mount CDROM: Mount/dev/CDROM/mnt/CDROM
  • Mount a USB flash drive: Mount/dev/sda1/mnt/USB
  • Unmount/mnt/CDROM
  • View the process PS to stop a process. The kill priority is nice renice.
  • Process Automation cron at batch
  • Unzip tar-zxvf nmap-3.45.tgz
  • Installation: rpm-I file. rpm
  • Space usage DF-A (-T)
  • Statistical space size Du-s only show total-H show specific size
  • File Size LS-SH
  • Show partitioned fdisk-l
  • Adjust partition size parted
  • Format mkfs
  • Disk e2fsck/dev/hdax-a fixed
  • MD5 verification: md5sum X. ISO
  • Memory: Free-m
  • Kernel version uname-A (-R)
  • System Information uname-
  • Boot information dmesg
  • Host Name hostname IP: Hostname-I ping
  • Configure ifconfig
  • Telnet (log out)
  • FTP (>! Exit)
  • Netstat network connection information
  • Programming style, beautify C source code: indent-kr-i8 Quan. c
  • Glibc library ftp://ftp.gnu.org/gnu/glibc
  • View version: rpm-Q glibc
  • Background processing: Hello &
  • If you want to end kill 3216, use kill-9 2365
  • Command combinations separated by semicolons: Pwd; Date
  • Use cat to create a file: CAT> file. tmp, enter the file, and press Ctrl + D.
  • Number of lines in the WC statistics File
  • View shell: Echo $ shell change: CHSH
  • BG conversion process to the background
  • FG conversion process to foreground
  • Log on to login and exit logout or
  • Change passwd password terminate program Ctrl + C Delete break
  • Date termination input Ctrl + d
  • Displays the list of users logging on to the system. Who su switches to the Super User
  • Show your login name who am I
  • Whereis: query the command directory and help document directory
  • Which: query the directory where the command is located (similar to whereis)
  • ID: print your UID and GID. (UID: the unique ID of a user. GID: the unique ID of a user group. Each user can have only one unique UID and gid)
  • History command: History
  • !! Last Command executed
  • Finger allows users to query data of other users
  • Start the mail program mailx mail exit the mail system x and enter the mail number to read, such as: 2
  • View the environment variable printenv echo $ PATH env
  • Add the environment variable export Path = $ path:/directory
  • Delete environment variable unset test set read-only test
  • Current working directory PWD current user home directory
  • Current Shell seconds (seconds) Previous working directory oldpwd
  • History command histfile histsize Level 1 prompt PS1 Level 2 PS2
  • Escape Character:\! History number of this command \ n newline \ t time \ ddate \ u username \ H hostname \ W Current Directory
  • File Operation copy CP Delete RM mobile mv
  • View LS-l-

-Rwxrwxr-x 2 feisky 5022 07-15

-File type:-General File d directory B block Device C character device P channel l link file

Rwx read and write permissions: three groups, owner, group, and others

2 connections

Feisky: Group of the owner

5022 File Size

07-15 Last modified Date and Time

A file name

  • Modify file access permissions: chmod U-X, G + W, O + W file. a u: User G: Group O: Other A: All
  • Modify file ownership: chown A. Out Fei
  • Chgrp A. Out Fei
  • File type determination: file Satellite
  • Rename: MV Path 1 Path 2
  • Link: ln file name New File Name
  • Output redirection:
  • > Redirect the output to a file (new file)
  • > Append redirection. Only Add at the end, for example, Cal 2007> 2007.
  • Input redirection: <
  • Pipeline: | directly obtain the output of a program as the input of the next program without generating a temporary file
  • Ls-L/dev/hda * | rev | cat
  • Ls display color when viewing files:1. Blue --> directory 2. Green --> executable file 3. Red --> compressed file 4. Light blue --> linked file 5. Gray --> other files
  • Mount a USB flash drive on the Development Board: Mount-T vfat/dev/SCSI/host0/bus0/target0/lun0/Part1/mnt
  • View the local IP Address: ifconfig
  • Add System Path: Export Path = $ path:/usr/local/ARM/2.95.3/bin/
  • CTRL + R History commands
  • Format code: indent-Kr-i8 test. c
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.