Linux Related Tips

Source: Internet
Author: User
Tags get ip disk usage egrep

Modify the cue line to enter directory to create nano Modify color command: ps1= "[\e[1;36m][\[email protected]\h \w]\$[\e[0m]"

To save exit exit effects:

------------------------------------------------------------Modify the prompt/etc/issuecat/etc/issue before logging in to view the changes before login prompt/etc/ Issue find help to modify the effect according to your needs:------------------------------------------------------------Modify the MOTD login prompt to delete the system MOTD file Rm-f/ ETC/MOTD Enter/etc directory RZ command Incoming file upload from Windows system successful exit:------------------------------------------------------------CentOS7 in LS/MISC/CD Unable to mount workaround view Settings systemctl status AutoFS run on service systemctl start AutoFS set power on boot systemctl enable AutoFS:------------------------------------------------------------View Directory Color Cat/etc/dir_ COLORS------------------------------------------------------------Realization of recording screen function script-t 2> time.log-a cmd.session Input command Recording screen start simple input several commands as the end of the test exit back to the record: Cat cmd.session scriptreply time.log cmd.sessionscriptreply time.log Cmd.session------------------------------------------------------------Mount USB echo '---' >/sys/class/scsi_host/ Host2/scanecho '----' >/sys/class/scsi_host/host2/scan

------------------------------------------------------------Delete History find the. bash_history file clears the history in memory (note order) rm. Bash_ Historyhistory-c------------------------------------------------------------screen for Centos7 Need to install screen package Create screen view screen Screen-ls connection effect Peel Ctrl + A D re-connect Screen-r Help------------------------------------------------------------Mail Send mail to receive mail

------------------------------------------------------------deleted users after the recovery method to create user useradd test1 Delete user rm-rf/home/ Test1mkdir/home/test1cp-r/etc/skel/. /home/test1------------------------------------------------------------Change account encryption algorithm Cat/etc/login.defsauthconfig-- passalgo=sha256--update View Shadowshadow root account changed to $------------------------------------------------------------ Attach group-related file locations and add group members, remove groups member/etc/group: additional group and its attribute information Group name password Group ID Group Member/etc/gshadow: additional group group password and related attribute group name Group Password group member above two files must be synchronized Can look at man help explain man Gshadow generally do not manually use the command to change to add users to the group Usermod-g test root Remove the user groupmems-g test-d root from the test group------------------- -----------------------------------------Get IP Method 1 ifconfig ens33|head-n2 | tail-n1| Tr-s "" |cut-d ""-f3 Method 2 ifconfig ens33|grep-o ' [0-9]{1,3}. [0-9] {1,3}. [0-9] {1,3}. [0-9] {1,3} ' |head-n1 Method 3 ifconfig ens33|grep-w ' inet ' |grep-o ' [0-9.] {7,15} "|head-n1 method 4 ifconfig ens33|grep-o" inet [0-9.] + "|cut-d" "-f2 method 5 ifconfig eth0|grep-w inet |grep-o ' ([0-9]{1,3}.) {3} [0-9] {1,3} ' |head-n1 method 6 ifconfig eth0|grEp-w inet |grep-eo ' ([0-9]{1,3}.) {3} [0-9] {1,3} ' |head-n1 method 7 ifconfig ens33|head-n2|tail-n1|tr-s "|cut-d" "-f3---------------------------------------------- --------------random Number 10-bit TR-DC ' [: alnum:] ' </dev/urandom | HEAD-C10 Statistics RPM Package number Ls/misc/cd/packages/|grep-o "[^.] +.rpm$ "|cut-d.-f1|sort |uniq-cls/misc/cd/packages/*.rpm |rev|cut-d.-f2|rev|sort |uniq- C------------------------------------------------------------grep take basename dirnameecho/etc/rc.d/init.d/ Functions|egrep-o ' [^/]+/?$ ' echo/etc/rc.d/init.d/functions|egrep-o ' ^.*/'--------------------------------------- ---------------------disk usage df |grep "^/DEV/SD" |tr-s ""% |cut-d%-f5|sort-nrdf|grep "/DEV/SD" |grep-eo "[0-9]{1,3}%" |g Rep-eo "[0-9]{1,3}" |sort-nr

Linux Related Tips

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: 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.