Some useful but unknown Unix Commands

Source: Internet
Author: User

Some useful but unknown Unix Commands

Many Linux commands come to mind, some of which are unknown and others are common, as follows:

  • Xargs or parallel: runs some programs in parallel and has many options for commands.
  • Sed and awk: widely known and useful command for processing text files, faster than Python and Ruby
  • M4: simple macro Processing Command
  • Screen: Powerful terminal reuse and session persistence tools, see http://www.ibm.com/developerworks/cn/linux/l-cn-screen/
  • Yes: Repeated output strings see http://codingstandards.iteye.com/blog/826940
  • Cal: Very nice calendar
  • Env: run a command, which is very useful in scripts.
  • Look: Search for English words starting with a string
  • Cut and paste and join: data operation command
  • Fmt: format a Text Segment
  • Pr: format a string of text or a large file in units of a page/column, see the http://hi.baidu.com/mchina_tang/item/1ce11d5d317dfc05aaf6d70d
  • Fold: wrap text
  • Column: format text into columns or tables
  • Expand and unexpand: Convert Between tabs and spaces
  • Nl: Add row number
  • Seq: print the row number
  • Bc: Calculator
  • Factor: the factor that outputs an integer. The factor outputs an integer prime factor.
  • Nc: Network debugging and Data Transmission
  • Dd: move data between files and devices
  • File: determines the type of a file.
  • Stat: view the File status
  • Tac: output file content from the last line, which is opposite to cat output
  • Shuf: randomly selects data for a file by row.
  • Comm: compare an ordered file by row
  • Hd and bvi: outputs or edits binary files
  • Strings: view the content in the binary file
  • Tr: character translation or operation character
  • Iconv or uconv: the string to be converted.
  • Split and csplit: Divide files
  • 7z: compressed files with high compression ratio
  • Ldd: View dynamic library information
  • Nm: view the symbol table in the target file
  • AB: website server stress testing tool
  • Strace: Debug system calls
  • Mtr: a better route tracking tool for network debugging
  • Cssh: Visual concurrent shell
  • Wireshark and tshark: Packet Capture and network debugging
  • Host and dig: Find DNS
  • Lsof: view process file descriptors and socket Information
  • Dstat: a useful statistical tool for system data.
  • Iostat: CPU and disk usage statistics
  • Htop: improved version of top
  • Last: logon history
  • W: Current Login User
  • Id: view User/group representation Information
  • Sar: Tools for viewing historical system statistics
  • Iftop or nethogs: view the network utilization of the socket or process
  • Ss: View statistics
  • Dmesg: startup or system error message
  • (Linux) hdparm: displays or sets disk parameters.
  • (Linux) lsb_release: view the release version of the linux System
  • (Linux) lshw: View hardware information
  • Fortune, ddate, and sl: It depends on whether you think the steam engine is more useful than quotes.

For more commands, see Joshua Levy's reply in another Q & A post, "command line saving skills that every Linux user should understand.


Who can give me some Common unix commands?

1.26 vi

[Syntax]: vi [-wn] [-R] file...
[Note]: vi is a full-screen editor based on the line editor ex. All commands of ex and ed can be used in vi, in the vi option, "-wn" indicates that the size of the editing window is set to n rows, and "-R" indicates that the edited file is set to read-only. The vi working mode is divided into command mode and input mode, in command mode, you can enter the vi command and edit the text to be edited when entering input mode, the command a A I I o O c s S R can enter the input mode. In the input mode, Press ESC to bring the input mode back to the command mode. In the command mode, enter: command, you can enter the ex mode, and a prompt is displayed at the bottom of the screen: at this time, you can use any ex command, the bottom line of the screen is also used /? ! Command Prompt line. Most commands can be preceded by a number, indicating the number of times the command is repeated. The following briefly introduces the vi command set, ^ represents (CTRL) Key.
^ B returns to the previous page. Adding a number to the previous page indicates the number of duplicates.
Retain the two rows of the previous page
^ D in command mode, it indicates half of the rolling screen. In input mode, it indicates rolling back
Auto indent on the left
^ E display the line below the screen bottom line
^ F indicates the number of duplicates on the previous page.
Retain the two rows of the previous page
^ G: displays the current file name, the current row number, and the total number of lines of the file.
Location in the entire file
^ H (unspace) in command mode, the cursor moves one cell to the left; in input mode, delete the previous character
^ I (TAB) generates a string of spaces in input mode.
^ J (LF) move the cursor down a row
^ L refresh the screen to re-display the screen
^ M (Press ENTER) in command mode, move the cursor to the beginning of the downstream
Open up a new line in input mode
^ N move the cursor down a row
^ P move the cursor up a row
^ In input mode, Q inserts the non-printable character after it into the body.
^ R refresh the screen
^ U the screen is rolled in half. Adding a number in front of the screen indicates the number of rows to be rolled up.
The subsequent ^ D ^ U command is valid.
^ V in input mode, insert the non-printable character after it as the body
^ W enables the cursor to return a word in input mode
^ Y displays the line above the screen bottom line
^ Z pause editing and return to the Upper Shell
^ [(ESC) Exit input mode and return to command mode
! Temporarily exit editing and execute Shell commands
Double quotation marks (double quotation marks) are used to mark the famous buffer, and serial number buffer 1-9 is used to save the deleted body, word
The parent name buffer zone a-z is used to store the custom body.
$ Move the cursor to the end of the current row. Adding a number before the cursor indicates moving the row forward, for example, 2 $ indicates moving
To the end of the next row
% Move the cursor to the paired parentheses () or braces {}
(Return the beginning of the sentence
) Forward to the beginning of a sentence
-Return to the first non-space character in the previous line
. Repeat the last command to change the buffer content
/Mode: Forward search mode. move the cursor to the appearance of the mode. The mode is a regular
Expression (see grep)
: At the bottom of the screen, you can use the ex command.
? The function is the same as/, but the direction is forward lookup.
[[Move the cursor back to the boundary of the previous section
\ Specifier
] Move cursor forward to the section boundary
^ (Not CTRL) move the cursor to the first non-empty character in the current row
"Two consecutive" means to move the cursor to the position before it moves, "followed by a letter means the cursor word
The beginning of the line marked by the mother (refer to the m command)
A inserts the body at the end of A row into the input mode.
B. move the cursor back to a word.
C. Content after replacing the cursor
D. Delete the content after the cursor.
E move the cursor to the end
The F character searches for the specified character on the left of the current line.
G move the cursor to the row specified by the number before it, and move to the last row if not specified
H move the cursor to the top line of the screen. If there is a number in front, move it to the number on the screen.
Specified row
I insert the body at the beginning of a row
J connects two rows. If there is a number in front, the row specified by the number is connected.
L move the cursor to the bottom line of the screen. If there is a number in front, move the cursor to the bottom line of the screen to count this
Row specified by number
M move the cursor to the midline of the screen
N use mode to find... the remaining full text>

What are common UNIX commands?

Common UNIX Commands
Common UNIX Command formats:
Command [flags] [argument1] [argument2]...
The flags starts with-. Multiple flags can be connected with one, for example, ls-l-a is the same as ls-la.

Parameters are optional or required based on different commands. All commands accept input and output from standard input.
The result is displayed in the standard output, and the error message is displayed in the standard error output device. You can use the redirection function
These devices are redirected.

The command returns a value of 0 after the normal execution result. If the command fails to be completely completed,
Non-zero value (available variable $ in shell? View). This return value can be used as the control logic in shell script.
.

Note: flags may be different for different UNIX versions.

1. User-related commands
1.1 login
(In LINUX Redhat, this command function is different from Solaris/BSD. login execution will exit the current task ).

Login:
Password:

Related Files:
Set the path, terminal type, other variables or special programs necessary for shell Running in the following files.

$ HOME/. profile (Bourne shell, sh, bash)
$ HOME/. cshrc (csh, tcsh)
$ HOME/. tcshrc (tcsh)
The/etc/passwd file lists the shells of each user.
/Etc/csh. cshrc
/Etc/csh. login
/Etc/profile (Bourne shell, bash)
/Etc/login (Bourne shell, bash)

Csh:/etc/csh. cshrc and $ HOME/. cshrc are read each time they are executed,
While/etc/csh. login and $ HOME/. login are executed only when shell is registered.
Modify the file and use source. cshrc to modify the file. If the path is modified
You also need to use rehash to refresh the executable file hash table.

Tcsh: $ HOME/. tcshrc. No files are read. cshrc

Sh:/etc/profile and $ HOME/. profile register shell
Bash:/etc/profile and $ HOME/. bash_profile register shell read
. Bashrc interactive non-register shell to read.

Manually execute related files in sh/bash:
./Etc/profile

Execution sequence of Related Files
Sh:/etc/profile-> $ HOME/. profile
Csh/tcsh:/etc/csh. cshrc->/etc/csh. login-> $ HOME/. cshrc
-> $ HOME/. login

Variable settings:
Sh/bash: TERM = vt100; export TERM
OR: export TERM = vt100 (bash)
Csh: setenv TERM vt100

Common variables:
(1) Backspace $ HOME/. profile $ HOME/. cshrc
Stty ...... remaining full text>

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.