Common shell commands

Source: Internet
Author: User
nl

Show file line number
nl myscript

Printf

formatting text
%[-+]m.nx
-The starting position from the beginning of the line
m represents the width of the field and N indicates the maximum width of the field
S: String.
C: Character.
D: number.
X:1 6 binary number.
O:1 0 binary number.

SZX1000366880:~ # printf "0x%x\n" 12000x4b0
Script

Record the operation process

scrpit mycmd.log
Strings

To view text in a binary file

strings file
Uname

Displays information about the current operating system

Wait ProcessID

Wait for process to end

Wc

Count characters, number of lines, number of words

wc -cwc -lwc -w
Whereis

Displays the path of the binaries and their online manuals

Whoami/who

Current login Name

BaseName

Detach a file name from a path

DirName

Detach a part of the file name from the path

Cat file1 file2 > File3

Merge 2 files

Diff

Comparison of two files

dircmp

Comparison of two folders

File filename

Determine file type

Fuser-u/DEV/SDB1

Show all processes that access the device
···
Fuser-k file kills all processes that access files
···

Common shell commands

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.