Linux shell command

Source: Internet
Author: User

Cat/proc/meminfo
Cat/proc/cpuinfo
Ipcs-a
Ipcs-m
Ipcs-s
Ipcs-q

Mkdir-p name when the parent directory does not exist is to create it

INFOCMP VT100

Echo $TERM

Xterm

Konsole

Getconf Long_bit

Arch

Release= ($ (</etc/redhat-release))


Lsb_release

CD-

RZ sz

echo $PS 1

Ls-f (after the directory Plus/)-R (List all directories)-l-i (node)-sail (combination)
Ls-l file filter, file can match my* my?

Touch file

Cp-p (Preserve access, modify time copy)-R (Recursive)-f (mandatory, overwrite already available)
Cp-l file1 file2 Create a hard link to file1 file2
Cp-s file1 file2 Create a soft link to file1 file2 (only in the current directory)

Stat file

File 1.txt

Cat-n (line number)-B (Text line line number)-T (does not allow tab appearance)

More (d,q,s,f,b,n,v,=)
Less tail head

Ps-ef viewing a process running on a system
Ps-l
Ps-efh

Kill num
Kill-s Signal
Killall *

MOUNT-T Type device directory (Ro,rw,usr,check=none,loop)

Df-h Show Disk space
Du-c-s-h Display directory space

Sort file (sorts data within text)-N (distinguishes between numbers and strings)-m (identifies three-letter month)-T (delimiter)

grep t-v-n-c-E

Bzip2
Bzcat
Bunzip2
Bzip2recover

Gzip
Gzcat
Gunzip

Zip
Zipcloak
Zipnote
Zipsplit
Unzip

Tar..


PRINTENV Viewing global variables
Set shows all environment variables (local, and global) set by a particular process

Create a global variable: Export the local variable

Login Shell Read File order:
1,/etc/profile--->/ETC/PROFILE.D
2, $HOME/.bash_profile----> $HOME/.bashrca
3, $HOME/.bash_login
4. $HOME/.profile

Alias

useradd-d View
USERADD-M Create home Directory-S (change default shell)-R (delete)


Usermod
passwd
chpasswd
Chage
Chfn
Chsh

Finger user

Groupadd-n


Fdisk
Mkefs
Mke2fs
Mkfs.ext3
Mkfs.ext4
Mkreiserfs
Jfs_mkfs
Mkfs.xfs

FSCK Check and Repair file system

Pvcreate
Vgcreate
Vgdisplay
Lvcreate
Lvdisplay

Aptitude (Debian)


Emacs File

Date
W.H.O.
Expr
Bc
Test statement



In the shell

String <,> to escape
-N (not 0)-Z (whether 0)
Value:-eq-ge-gt-le-lt-ne
string = = = < >-n-z

File comparison
-D file exists and directory?
Is the-e file present?
-f file exists and file?
-R file exists and is readable?
-s file exists and is not empty?
-W file exists and is writable?
-X file exists and is executable?
-o file exists and belongs to the current user?
-G file exists with default value same as current user

File1-nt file2 file1 New to File2
File2-ot file2 old?

BaseName

$? Last Run result
$ #命令行参数个数
The $* variable saves all arguments supplied on the command as a single word
[Email protected] treats the arguments appearing on the command line as multiple separate words in a string


Getopt
Getopts

Echo-n Remove end line break
Read-p message
Read-t time
READ-NL Accept single word specifier exit

&> redirect multiple streams to a single stream

>&n Redirect to a numeric descriptor, add &

Echo Temporary redirect
EXEC Permanent redirect

Redirect to $-to indicate close descriptor

LSOF lists the system open file descriptor-A is for the following results and
$$ Special environment variable (the shell will set it as the current PID)

MKTEMP-T (Force created at/TMP)-D (temp directory)

Tee is equivalent to two pipes sent to both sides
Sleep 100

Ctrl + Z Hang signal
Ctrl + C terminating signal
Kill-9 PID

Trap command signals intercept signal

Elf_file & background run, but terminal quits, it ends
Nohup running in the background, even if the terminal exits

Jobs Control $$ Current PID
Restart stop job BG Job ID
Foreground run job FG Job ID

Nice-n 10 re-establishing process priorities

Renice re-enactment of already running priorities

At commits to the job queue ATD is the at daemon
at [-F filename] Time

ATQ Viewing wait jobs
ATRM Deleting jobs


Cron Schedule Table
Crontab-l List Schedules
/etc/cron.*ly


Anacron will not miss the plan, the above may be shutdown missed plan, this can be powered on the first time to run
/var/spool/anacron

Run script on Boot
/etc/init.d/rc.loacl
/etc/rc.local
/etc/rc.d/rc.local

Source executes the command in the current environment, rather than creating a new shell

Select to create a menu from a single command line

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.