Linux Command skills

Source: Internet
Author: User

Linux Command skills
[Oracle @ rh64 ~] $ Cat lgrw.txt cat: lgrw.txt: No such file or directory [oracle @ rh64 ~] $ ^ Rw ^ wr cat lgwr.txt 18:03:19. 703928 times ({tms_utime = 27, tms_stime = 18, tms_cutime = 0, tms_cstime = 0}) = 433678186 18:03:19. 704111 semtimedop (1900546, {15,-1, 0 }}, 1, {1, 660000000}) =-1 EAGAIN (Resource temporarily unavailable) 18:03:21. 364682 getrusage (RUSAGE_SELF, {ru_utime = {0, 278957}, ru_stime = {0, 184971 },...}) = 0 18:03:21. 364760 getrusage (RUSAGE_SELF, {ru_utime = {0, 278957}, ru_stime = {0, 184971 },...}) = 0
[Oracle @ rh64 ~] $ History -- 10-bash: history: --: invalid option history: usage: history [-c] [-d offset] [n] or history-anrw [filename] or history-ps arg [arg...] [oracle @ rh64 ~] $ ^ -- History 10 1002 ls-lte [oracle @ rh64 ~] $ Echo mount/dev/mapper/vg0-lv1/data1 mount/dev/mapper/vg0-lv1/data1 [oracle @ rh64 ~] $! : Gs/1/2 echo mount/dev/mapper/vg0-lv2/data2 mount/dev/mapper/vg0-lv2/data2 [oracle @ rh64 ~] $

Reference command line! [! | [?] String | [-] number]
: [N | x-y | ^ | $ | * | n * | %]: [h | t | r | e | p | s | g] ------- select word ---- modifier -----
!! --- Previous command! Cat commands starting with cat [oracle @ rh64 ~] $! Cat/etc/passwd root: x: 0: 0: root:/bin/bash bin: x: 1: 1: bin:/bin: /sbin/nologin daemon: x: 2: 2: daemon:/sbin/nologin adm: x: 3: 4: adm:/var/adm:/sbin/nologin
!? Cat commands containing cat [oracle @ rh64 ~] $ !? Cat/etc/passwd root: x: 0: 0: root:/bin/bash bin: x: 1: 1: bin:/bin: /sbin/nologin daemon: x: 2: 2: daemon:/sbin/nolog
! N nth command! -N penultimate n commands
! $ The last digit of the previous command
! ^ First place of the previous command
! : N the nth bit of the previous command
! : X-y
! : N * last n to last
! * All parameters above
: H: select the beginning of the path
: T select the end of the path
: R select the file name [oracle @ rh64 ~] $ Echo a.txt [oracle @ rh64 ~] $! $: T a.txt-bash: a.txt: command not found [oracle @ rh64 ~] $ Echo! $: R echo a: e: select the extension [oracle @ rh64 ~] $ Echo abc.jpg [oracle @ rh64 ~] $ Echo! $: E echo. jpg. jpg
: P print command line [oracle @ rh64 ~] $! E: p echo. jpg [oracle @ rh64 ~]
: S replace % echo this that %! : S/is/e echo the that usage: ^ is ^ e [oracle @ rh64 ~] $ Echo this that [oracle @ rh64 ~] $! : S/is/e echo the that the [oracle @ rh64 ~] $ ^ Is ^ e-bash: s ^ is ^ e: substitution failed [oracle @ rh64 ~] $ Echo this that [oracle @ rh64 ~] $ ^ Is ^ e echo the that [oracle @ rh64 ~] $
: G for global replacement [oracle @ rh64 ~] $ Echo abcd abef [oracle @ rh64 ~] $! : Gs/AB/cd echo cdcd cdef [oracle @ rh64 ~] $

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.