Linux OPS 1, Chapter 2

Source: Internet
Author: User
Tags bz2

Pwd-p returns the true path of the link


Cd/usr/src

Cd..

CD-

CD Home


Ls-al

Ls-ld/root

Ls-lt


Cp/etc/hosts/tmp/host

Cp-r/var/log//tmp


Find-name Hello.doc

Find/root-name "*.log"

Find-iname "Jacob"

Find/-empty

Find/-group Tom

Find/-mtime-3

Find/-mtime +4

Find/-mtime 2

Find./-size +10m

Find./-type F

Find./-user Tom

Find./-size +1m-exec ls-l {} \;

Find/-size +1m-a-type F



Du-sh



Cat-n/etc/passwd

Cat-b/etc/passwd



Head-c 20k/root/install.log



Tail-f/var/log/messages


Wc-l

-W

-C


grep--color th Test.txt

Grep-i the Test.txt

Grep-w Num test.txt

Grep-v the Test.txt



echo "Hello World."

Echo-e "\ \"

\\

\ n

\ t



Ln-s/test//var/test/

Ln/test/hello.txt/test/hi.txt



Gzip Hell.txt

Gzip-d hello.txt.gz



Bzip2 Hello.txt

Bzip2-d hello.txt.bz2



TAR-CF etc.tar/etc

Tar-czf Boot.tar.gz/boot

TAR-CJF etc.tar.bz2

TAR-TVF boot.tar.gz

TAR-XVF Etc.tar

Tar-xzf boot.tar.gz

TAR-XJF etc.tar.bz2

TAR-XZF BOOT.TAR.GZ-C/tmp



History

!500



Ctrl+l Clear


which find



Vim Editor

A A

I I

o O


Gg

G

NG

^ $

W b



X

Dd

Ndd

Rx

Yy

P

P


/host N N


: s/root/admin/

: s/root/admin/g

: 3,5s/root/admin/g

:%s/nologin/fault/g



: Set Nu


: Split

Ctrl+w +l

+j


: Vsplit

Ctrl+w+h

+l


Useradd-c administartor-d/home/admin-e 2013-12-24 \

-G root-g bin,adm,mail Admin

Useradd-s/sbin/nologin-m User2



Groupadd-g Jerry


ID Root


echo "123456" | passwd--stdin Tom

Passwd-l Tom

Passwd-u Tom

Passwd-d Tom


usermod-d/home/tom Tom #/home/tom exists

USERMOD-E 2013-12-24 Tom

USERMOD-G Mail Tom

Usermod-s/bin/bash Tom

Usermod-u 1001 Tom


Userdel-r Tom

Groupdel Jerry




chmod A=RW Install.log

chmod a+x Install.log

chmod 644 Install.log

chmod--reference=install.log.syslog Install.log



Chown:root Install


Account Management Case

Mkdir-p/var/{teach,office}


Groupadd teach

Groupadd Office


Useradd-g Teach Op_teach

USERADD-G Office Op_office


Useradd-g Teach Endy

Useradd-g Office Lucy


Gpasswd-a Op_teach teach

Gpasswd-a Op_office Office


chmod Op_teach.teach/var/teach

chmod Op_office.office/var/office

chmod 755/var/{teach.office}




Fdisk-l

Fdisk/dev/sda

Partprobe/dev/sda




Mkfs.ext4/dev/sdc1

Mkswap/dev/sdc2


Mount/dev/cdrom/media

Umount/dev/cdrom

Vim/etc/fstab

Mount-a




Create raid

(fdisk FD)

Mdadm-c/dev/md0-l 0-n 3/DEV/SDB1/DEV/SDC1/DEV/SDD1

Mdadm-c/dev/md5-l 5-n 3-x 1/dev/sdb2/dev/sdc2/dev/sdd2/dev/sde2


Mdadm--detail/dev/md0

Mdadm--DETAIL/DEV/MD5


Mkfs.ext4/dev/md0


echo "Device/dev/sdb1/dev/sdb2/dev/sdc1/dev/sdc2/dev/sdd1/dev/sdd2/dev/sde2" >/etc/mdadm.conf

Mdadm-evs >>/dev/mdadm.conf


echo "/dev/md0/raid0 ext4 defaults 0 0" >>/etc/fstab

echo "/dev/md0/raid0 ext4 defaults 0 0" >>/etc/fstab



Time DD If=/dev/zero of=txt bs=1m count=1000




RPM-IVH ftp-0.17-51.1.el6.x86_64.rpm

RPM-E FTP


Rpm-q FTP

Rpm-aq

Rpm-qi Bash

RPM-QL Bash

RPM-QC Bash

Rpm-qf/etc/inittab


Rpm-qpi ftp-0.xxxxxxxxxxxx.rpm



/etc/yum.repos.d/media.repo

[Media]

name=centos=6.7

Baseurl=file:///media/centos-6.3_final

Enable=1

Gpgcheck=0

gpgkey=


Yum Install Dialog

Yum-y expect

Yum Remove Dialog

Yum List

Yum Clean All

Yum Grouplist

Yum Groupintall "Chinese support"




Yum-y intall gcc pcre pcre-devel libtool


TAR-XJF httpd-2.2.23.tar.bz2-c/usr/src/

TAR-XZF apr-1.4.6.tar.gz-c/USR/SRC


cd/usr/src/apr-1.4.6/

./configure && make && make install

cd/usr/src/apr-util-1.5.1

./configure--WITH-APR=/USR/LOCAL/APR

Make && make install

...

/usr/local/apache2/bin/apachectl start



Date-s "2012-11-12 14:00"

Hwclock-w



Service sshd Reload


Chkconfig--list

Chkconfig--list sshd

Chkconfig--level-sshd off

Chkconfig sshd on




Service ATD Start

At 23:11

TAR-CJF Log.tar.bz2/var/log

Shutdown-h now


At-l

At-c 1

At-d 1



Service Crond Start

Chkconfig Crond on


Crontab-e

* TAR-CZF Log.tar.gz/var/log

XX */3 * * * WHO

Crontab-l

Crontab-r


/etc/cron.d

/etc/cron.hourly

/etc/cron.daily

/etc/cron.weekly



Uptime


free [-b|-k|-m]




Df-ht

Df-i



Ifconfig


Netstat-nutlp


Ps-e

Ps-ef


Top

M memory N PID Z Highlight


Top-d 1-p



Ifconfig eth0 192.168.0.31 netmask 255.255.255.0

Ifconfig eth0 Down

Ifconfig eth0 up



Hostname

Hostname centos.example.com

Hostname-i




Route

Route-n

Route add default GW 192.168.0.254

Route add-net 172.16.0.0/16 GW 192.168.0.254

Route add-net 192.56.76.0 netmask 255.255.255.0 Dev eth0


Route del default GW 192.168.0.254

Route Del-net 172.16.0.0/16



Cat/etc/sysconfig/network-scripts/ifcfg-eth0

Device= "

bootproto= "Static"

Hwaddr= "

Nm_controlled= "

Onboot= "

Type= "

Ipaddr= "192.168

prefix= "24"

Gateway= "192.168.0.254"

dns1= "202.106.46.151"


Service Network restart



Vim/etc/sysconfig/network-scripts/route-eth0

Service Network restart




Ping

Traceroute

Traceroute-i www.google.com

Nslookup www.google.com

Dig www.google.com


Netstat-an

Netstat-nutlp


/lib/modules/' uname-r '/

Lsmod

Modprobe Ip_vs

Lsmod | grep Ip_vs

Modprobe-r Ip_vs

Modinfo Ip_vs


echo "Modprobe ip_vs" >>/etc/rc.sysinit



echo "1" >/proc/sys/net/ipv4/ip_forward

echo "1" >/proc/sys/net/ipv4/icmp_echo_ignore_all

echo "108248" >/proc/sys/fs/file-max



Vim/etc/sysctl.conf

Net.ipv4.ip_forward = 1

Net.ipv4.icmp_echo_ignore_all = 1

Fs.file-max = 108248


Linux OPS 1, Chapter 2

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.