Common Commands under Linux

Source: Internet
Author: User
Tags bz2 create directory diff disk usage

=============== installation and Landing commands =============================================================

Mount: Mount command. Designate storage media as a directory in the system (access resources in other file systems under running Linux), such as Mount Optical drives Mount/dev/cdrom

Mount the CDROM to view content under directory/mnt/cdrom.

Umount: Uninstall command, such as Uomunt/dev/cdrom.

Exit: Exit the terminal command.

Shutdown: Shut down the Linux system and add parameters later, such as shutdown now.

Reboot: Restart Linux.

Halt: Hangs the system but does not shut down.

Chsh: Change the shell that logged into the system.

TTY: Displays the file name of the terminal connection standard input device.

=============== File Processing command =============================================================

LS: Displays the current directory contents. The Add parameter path can display the specified directory contents,/specific referring to the root directory.

-L: Displays detailed information such as permissions for files in the directory.

-all: Displays the most detailed information.

|more can display the directory file information, enter follow-up, Shift+page up/down page.

Find: Finds files. The format is: Find. -name "*.java" or find. -name \*.java, where. Represents the current directory,-name represents the lookup by name, * that is, a wildcard character.

RM: Delete the directory or file. Add parameter-RF Strong Delete a non-empty directory. For example, to delete the target file under the current file recursively, using:

Find. -name *.o-type f-exec rm-f {} \;

CD: Enter a directory. /indicates the Linux root directory

CD ~ Return to the user directory under Home

Cd.. Return to upper level directory

CP: Copy command.

CP 1.txt usr/local/arm Copy the 1.txt file in the current directory to the target directory

./: Executes the current directory application, followed by the application name to do the parameter

Cat: View the contents of a file, followed by the file name, if the file content is too long, execute

Cat file name | Less up and down key move

Cat/proc/version viewing the Linux kernel version

Cat/proc/meminfo Viewing memory information

Cat/proc/asound/cards Viewing sound card information

Cat > file name the cat output is relocated to the back file and overwrites the file

Cat **.wav >/DEV/SND/DSP or cat **.wav >/dev/snd/audio play audio file enable

Cat/proc/asound/oss/sndstat Viewing OSS configuration information

Cat/prop/asound/version View ALSA version

Cat/proc/interrupts Viewing interrupt assignment information

MORE: Similar to cat, but will be a page by page display, the Space bar page, the letter B will go back to a page display

mkdir: Create Directory command. Or create the next level directory under an existing directory, you cannot create a multi-tier catalog at one time

diff: Compare two text lines at a line

diff file1 File2 Get N1, N2 c N3, N4, where n1n2 refers to a number of lines in the first file, and N3n4 refers to a number of rows in the second file.

Middle letter A means add, d means delete, C refers to modify

Make Menuconfig: Graphical interface configuration system kernel parameters

MV: Move or rename files or directories

MV name1 PPP renaming NAME1 to PPP

MV name1/usr/moving files to the target directory

Apt-get: Used to automatically find the installation software, update software, generally require root permissions, generally require root permissions, so the format is

sudo apt-get install installation

sudo apt-get Remove Uninstall

sudo apt-get upgrade upgrade

Fgrep: Global find command to find specific string literals in all text files in a specific directory

Fgrep "Unable to install HW params" external/alsa-lib/*-r similar to grep function

|: Pipe command, usually the output of the left command of the pipeline as a command input to the right of the pipe

Head: View the first few lines of a file

Head-5/etc/passwd Viewing the first five elements of a file

Tail: View the following lines of a file

TAIL-10/ETC/PASSWD viewing the following 10 lines of a file

Alsa_aplay: Play Test sound command

Alsa_aplay Xxx.wav

Alsa_amixer: Mixer Information and commands

Alsa_alsact1:alsa Control

Arecord: The plus-l parameter lists the current digital audio device, plus-l lists the current PCM device.

arecord-d Device name Xxx.wav can be recorded

=============== System Administration Command =============================================================

PWD: Displays the full current working directory

Source: Typically used to re-execute a newly modified initialization file for immediate effect without having to log off and log back on

SOURCE ~/.BASHRC changes the environment variable to take effect immediately

LS Dev: Display system device

DF: Displays current system disk usage and mount information

Top: Display resource status, similar to XP-based resource Manager

Free: Displays system memory usage

At: Perform a specific action at a specified time

AddUser: Add a user to the home directory

Useradd: With AddUser is a thing

Groupadd: Create a new group

Unzip: extracting Zip files

Gzip: Compress files into. gz files

Gunzip: extracting. gz files

Last: Lists information about past and current users logged into the system

LSPCI: View hardware chipset with LSPCI-V

LSUSB: Display system USB Bus device information

Lsmod: Displays the module information that the system has loaded

Uname: View system hardware and software information

Uname-r-m-p-I get information such as kernel version and processor architecture

Insmod: Load module, Linux many functions are through the way of the module, when needed to load kernel

Rmmod: Uninstalling the module

RPM: Features similar to "Add/Remove Programs" in Windows,

Rpm-q modutils Query System There is no Modutils package

MPlayer: Use the toolkit to debug and use sound

MPlayer Xxx.wav plays an audio file that displays the device used for the current audio

Mplayer-ao Alsa xxx.wav to play with ALSA audio components

FDISK: Display disk mount and assignment information

sudo fdisk-l display mount point, purpose

DMESG: Print kernel information, some print statements are output to the kernel rather than the terminal

Lsof: Show all processes that open files, etc.

Lsof Abc.txt shows the process of opening abc.txt

=============== Network Operation Command =============================================================

Service Network restart: After configuring the network service, restart

IP: Integrated with ipconfig and route two instructions

Ping: Like XP, CTRL + C stop command

Netstat: Displaying network connections, routing tables, and network interface information

Telnet: Turn on the terminal stage job and log in to the remote host

Rlogin: Open terminal stage and log in to remote host

Finger: Display the user name, home directory, stall time, login shell and other information of a user in the system

Mail: Message information

W3W: Terminal login in text version browser

=============== System security Command =============================================================

passwd: Change Password

Su: Change to the identity of other users, except for superuser, you need to type the user's password

Umask: Determines the default mode in which you create the file, as opposed to the chmod command, such as: Umask 777

sudo: A tool that allows a system administrator to allow an ordinary user to perform some or all of the root commands

chmod: Change file permissions.

chmod 777 cc Set CC permissions to 777

The first bit is the file owner, the second is the group permission, and the third is the other person's permission.

The permissions for each bit are read (4), write permission (2) and Execute permission (1)

Chown: Changing the owner and group associated with a file

Chown Jim Program.c-PROGRAM.C user access right now applies to Jim

Chown-r JOHN:BUILD/TMP/SRC Associates All files below the SRC directory to user John, group build

===============vi Edit Command =============================================================

VI Editor Operation:

Exit: ESC, press SHIFT+:,Q. Where q! forced to quit, Wq after saving

Edit: Press I to enter edit mode

Find: Press ESC to exit edit mode, execute "/word" to find the string, press N to find the next

Copy: Press ESC to exit edit mode,

Copy the current line: by YY, jump cursor to the target line;

Copy Multiple lines: Enter the number of lines, and then press YY, jump cursor to the actually navigation

Paste: Jump cursor to target line after copy, press P

=============== compression and Decompression commands =============================================================

. tar.gz types

Decompression: Tar zxvf FileName.tar.gz

Compression: Tar zcvf FileName.tar.gz DirName

Compress the contents of the dirname into a compressed document named after the filename.

. tar.bz2 types
Decompression: Tar jxvf FileName.tar.bz2
Compression: Tar jcvf FileName.tar.bz2 DirName
. Tar types
Decompression: Tar xvf Filename.tar
Package: Tar cvf filename.tar DirName

This command does not function as a compression

This article references: http://mp.weixin.qq.com/s?__biz=MzA4MTcyOTEwMw==&mid=207675444&idx=1&sn= 12568419e2b1b69522b064d90adc5571&scene=0&key= 0acd51d81cb052bc0c28685433aa3bca6135d0a9dcf66afa2245cd20715c6d474a9d8db3f109e41a768c5af7d7dd7bb6&ascene=1 &uin=mjqxmjqxnti2ma%3d%3d&devicetype=webwx&version=70000001&pass_ticket= Dfooufy1l2faaruakqd2bxz1%2fmhdyd1ax764kqq3jixesjpw6oxnmmrgrwevsnj3

Common Commands under Linux

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.