Hacker Technology--linux Command line __linux

Source: Internet
Author: User
Tags auth

Many are consistent with regular expression re; 1. Modify last executed command

Remove redundant parts;

% grep fooo/var/log/auth.log
% ^o
% grep foo/var/log/auth.log

Replacement (Error or loss):

# Replace

% cat myflie
% ^li^il%
cat myfile


# missing% ansible vod-m command-a '

uptim '
% ^im^ime
% Ansible vod-m command-a ' uptime '

Advanced Replacement:

% ansible nginx-m command-a ' which nginx '
%!:gs/nginx/squid
% ansible squid-m ' command-a squid '
% ^nginx^squid^:g # zsh
2. Use command line to enter history

Query history

$ echo $HISTSIZE
$ echo $HISTFILE

$ history
$ history | Less
$ history 5

!$: Last parameter of previous command

$ mkdir Videos
$ cd!$

!^: first parameter of previous command

$ ls/usr/share/doc/usr/share/man
$ cd!^    

: t: Intercept the end of the path

$ wget http://nginx.org/download/nginx-1.4.7.tar.gz
$ tar-zxvf!$:t
tar-zxvf nginx-1.4.7.tar.gz
                # is equivalent to taking BaseName

: r: Intercepting filename

$ unzip Filename.zip
$ cd!$:r
CD filename
: E: File Development name ReferencesUse Linux command line to efficiently use Linux command line like hackers
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.