Back to Linux

See Also GNU Core Utilities

Unix-like Utilities

Below utilities can be found on Unix operating systems and most Unix-like operating systems.

1. Linux Common Commands

attachment:linux-command.png

2. Install on Mac OS

2.1. GNU Core Utilities

➜  ~  brew install coreutils
export PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
export MANPATH="/usr/local/opt/coreutils/libexec/gnuman:$MANPATH"

➜  ~ brew install gnu-sed --default-names
➜  ~ ln -s /usr/local/opt/gnu-sed/libexec/gnubin/sed /usr/local/opt/coreutils/libexec/gnubin/sed

3. Practice Utility List

3.1. sysstat

The sysstat package contains utilities to monitor system performance and usage activity. Sysstat contains various utilities, common to many commercial Unixes, and tools you can schedule via cron to collect and historize performance and activity data.

Command

Description

iostat

reports CPU statistics and input/output statistics for devices, partitions and network filesystems.

mpstat

reports individual or combined processor related statistics.

pidstat

reports statistics for Linux tasks (processes) : I/O, CPU, memory, etc.

sar

collects, reports and saves system activity information (CPU, memory, disks, interrupts, network interfaces, TTY, kernel tables,etc.)

sadc

is the system activity data collector, used as a backend for sar.

sa1

collects and stores binary data in the system activity daily data file. It is a front end to sadc designed to be run from cron.

sa2

writes a summarized daily activity report. It is a front end to sar designed to be run from cron.

sadf

displays data collected by sar in multiple formats (CSV, XML, etc.) This is useful to load performance data into a database, or import them in a spreadsheet to make graphs.

nfsiostat

reports input/output statistics for network filesystems (NFS).

cifsiostat

reports CIFS statistics.

3.2. net-tools vs iproute2

iproute2 is a collection of utilities for controlling TCP / IP networking and traffic control in Linux.

➜  svn  brew tap brona/iproute2mac
==> Tapping brona/iproute2mac
Cloning into '/usr/local/Library/Taps/brona/homebrew-iproute2mac'...
...
Tapped 1 formula (29 files, 120K)
➜  svn  brew install iproute2mac
==> Installing iproute2mac from brona/homebrew-iproute2mac
...
🍺  /usr/local/Cellar/iproute2mac/1.0.5: 4 files, 24K, built in 6 seconds
➜  svn  ip addr show en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether ...
        inet6 ...
        inet 10.100.100.186/23 brd 10.100.101.255 en0

3.2.1. See Also

netstat: netstat -anp |grep 80 ss -antp sport = :80

lsof: lsof -i :80

3.3. Other Monitor Tools

3.3.1. vnStat

vnStat is a console-based network traffic monitor for Linux and BSD that keeps a log of network traffic for the selected interface(s).

# yum --enablerepo="epel" install vnstat
# service vnstat start
# chkconfig --level 2345 vnstat on

3.4. Other Useful Tools

3.4.1. Editor

3.4.2. Process Management

3.4.3. Security

3.4.4. Performance

4. IEEE Std 1003.1-2008 utilities

IEEE Std 1003.1-2008 utilities

Name

Category

Description

First appeared

awk

Text processing

Pattern scanning and processing language

Version 7 AT&T UNIX

basename

Filesystem

Return non-directory portion of a pathname; see also dirname

Version 7 AT&T UNIX

batch

Process Management

Schedule commands to be executed in a batch queue

bc

Misc

Arbitrary-precision arithmetic language

Version 6 AT&T UNIX

bg

Process Management

Run jobs in the background

c99

C Programming

Compile standard C programs

IEEE Std 1003.1-2001

cal

Misc

Print a calendar

Version 5 AT&T UNIX

cat

Filesystem

Concatenate and print files

Version 1 AT&T UNIX

cd

Filesystem

Change the working directory

Version 6 AT&T UNIX

cflow

C Programming

Generate a C-language flowgraph

System V

chgrp

Filesystem

Change the file group ownership

PWB UNIX

chmod

Filesystem

Change the file modes/attributes/permissions

Version 1 AT&T UNIX

chown

Filesystem

Change the file ownership

Version 1 AT&T UNIX

cksum

Filesystem

Write file checksums and sizes

4.4BSD

cmp

Filesystem

Compare two files; see also diff

Version 1 AT&T UNIX

comm

Text Processing

Select or reject lines common to two files

Version 4 AT&T UNIX

command

Shell Programming

Execute a simple command

compress

Filesystem

Data Compress Utilities

tar/gzip/bzip2/...

cp

Filesystem

Copy files

Version 1 AT&T UNIX

crontab

Misc

Schedule periodic background work

System V

csplit

Text Processing

Split files based on context

PWB UNIX

ctags

C Programming

Create a tags file

3BSD

cut

Text Processing

Cut out selected fields of each line of a file

System III

cxref

C Programming

Generate a C-language program cross-reference table

System V

date

Misc

Display the date and time

Version 1 AT&T UNIX

dd

Filesystem

Convert and copy a file

Version 5 AT&T UNIX

df

Filesystem

Report free disk space

Version 1 AT&T UNIX

diff

Text processing

Compare two files; see also cmp

Version 5 AT&T UNIX

dirname

Filesystem

Return the directory portion of a pathname; see also basename

System III

du

Filesystem

Estimate file space usage

Version 1 AT&T UNIX

echo

Shell programming

Write arguments to standard output

Version 2 AT&T UNIX

ed

Text processing

The standard text editor

Version 1 AT&T UNIX

env

Misc

Set the environment for command invocation

System III

ex

Text processing

Text editor

1BSD

expand

Text Processing

Convert tabs to spaces

3BSD

expr

Shell Programming

Evaluate arguments as an expression

Version 7 AT&T UNIX

false

Shell programming

Return false value

Version 7 AT&T UNIX

fc

Misc

Process the command history list

fg

Process Management

Run jobs in the foreground

file

Filesystem

Determine file type

Version 4 AT&T UNIX

find

Filesystem

Find files

Version 1 AT&T UNIX

fold

Text processing

Filter for folding lines

1BSD

fuser

Process Management

List process IDs of all processes that have one or more files open

System V

gencat

Misc

Generate a formatted message catalog

get

SCCS

Get a version of an SCCS file

PWB UNIX

getconf

Misc

Get configuration values

getopts

Shell Programming

Parse utility options

grep

Misc

Search text for a pattern

Version 4 AT&T UNIX

hash

Misc

hash database access method

head

Text processing

Copy the first part of files

PWB UNIX[''[[http://en.wikipedia.org/wiki/Wikipedia:Citation_needed|citation needed]]'']

iconv

Text processing

Codeset conversion

HP-UX

id

Misc

Return user identity

4.4BSD

ipcrm

Misc

Remove a message queue, semaphore set, or shared memory segment identifier

System V

ipcs

Misc

Report interprocess communication facilities status

System V

jobs

Process Management

Display status of jobs in the current session

join

Text Processing

Merges two sorted text files based on the presence of a common field

Version 7 AT&T UNIX

kill

Process Management

Terminate or signal processes

Version 4 AT&T UNIX

lex

C Programming

Generate programs for lexical tasks

Version 7 AT&T UNIX

link

Filesystem

Create a hard link to a file

Version 1 AT&T UNIX

ln

Filesystem

Link files

Version 1 AT&T UNIX

locale

Misc

Get locale-specific information

localedef

Misc

Define locale environment

logger

Shell programming

Log messages

4.3BSD

logname

Misc

Return the user's login name

4.4BSD

lp

Text Processing

Send files to a printer

System V

ls

Filesystem

List directory contents

Version 1 AT&T UNIX

m4

Misc

Macro processor

PWB UNIX

mailx

Misc

Process messages

Version 1 AT&T UNIX

make

Programming

Maintain, update, and regenerate groups of programs

PWB UNIX

man

Misc

Display system documentation

Version 2 AT&T UNIX

mesg

Misc

Permit or deny messages

Version 1 AT&T UNIX

mkdir

Filesystem

Make directories

Version 1 AT&T UNIX

mkfifo

Filesystem

Make FIFO special files

4.4BSD

more

Text processing

Display files on a page-by-page basis

3BSD

mv

Filesystem

Move files

Version 1 AT&T UNIX

nice

Process Management

Invoke a utility with an altered nice value

Version 4 AT&T UNIX

nl

Text Processing

Line numbering filter

System III

nm

C Programming

Write the name list of an object file

Version 1 AT&T UNIX

nohup

Process Management

Invoke a utility immune to hangups

Version 4 AT&T UNIX

od

Misc

Dump files in various formats

Version 1 AT&T UNIX

paste

Text processing

Merge corresponding or subsequent lines of files

Version 32V AT&T UNIX

patch

Text processing

Apply changes to files

4.3BSD

pathchk

Filesystem

Check pathnames

pax

Misc

Portable archive interchange

4.4BSD

pr

Text processing

Print files

Version 1 AT&T UNIX

printf

Shell programming

Write formatted output

4.3BSD-Reno

prs

SCCS

Print an SCCS file

PWB UNIX

ps

Process Management

Report process status

Version 4 AT&T UNIX

psmisc

Utilities for managing processes on your system

pstree, killall and fuser

/

pwd

Filesystem

print working directory - Return working directory name

Version 5 AT&T UNIX

qalter

Batch Utilities

Alter batch job

qdel

Batch Utilities

Delete batch jobs

qhold

Batch Utilities

Hold batch jobs

qmove

Batch Utilities

Move batch jobs

qmsg

Batch Utilities

Send message to batch jobs

qrerun

Batch Utilities

Rerun batch jobs

qrls

Batch Utilities

Release batch jobs

qselect

Batch Utilities

Select batch jobs

qsig

Batch Utilities

Signal batch jobs

qstat

Batch Utilities

Show status of batch jobs

qsub

Batch Utilities

Submit a script

read

Shell Programming

Read a line from standard input

renice

Process Management

Set nice values of running processes

4BSD

rm

Filesystem

Remove directory entries

Version 1 AT&T UNIX

rmdel

SCCS

Remove a delta from an SCCS file

PWB UNIX

rmdir

Filesystem

Remove directories

Version 1 AT&T UNIX

sact

SCCS

Print current SCCS file-editing activity

System III

sccs

SCCS

Front end for the SCCS subsystem

4.3BSD

sed

Text processing

Stream editor

Version 7 AT&T UNIX

sh

Shell programming

Shell, the standard command language interpreter

Version 7 AT&T UNIX (in earlier versions, sh was either the Thompson shell or the PWB shell)

sleep

Shell programming

Suspend execution for an interval

Version 4 AT&T UNIX

sort

Text Processing

Sort, merge, or sequence check text files

Version 1 AT&T UNIX

split

Misc

Split files into pieces

Version 3 AT&T UNIX

strings

C Programming

Find printable strings in files

2BSD

strip

C Programming

Remove unnecessary information from executable files

Version 1 AT&T UNIX

stty

Misc

Set the options for a terminal

Version 2 AT&T UNIX

tabs

Misc

Set terminal tabs

PWB UNIX

tail

Text processing

Copy the last part of a file

PWB UNIX[''[[http://en.wikipedia.org/wiki/Wikipedia:Citation_needed|citation needed]]'']

talk

Misc

Talk to another user

4.2BSD

tee

Shell programming

Duplicate standard input

Version 5 AT&T UNIX

test

Shell programming

Evaluate expression

Version 7 AT&T UNIX

time

Process Management

Time a simple command

Version 3 AT&T UNIX

touch

Filesystem

Change file access and modification times

Version 7 AT&T UNIX

tput

Misc

Change terminal characteristics

System V

tr

Text processing

Translate characters

Version 4 AT&T UNIX

true

Shell programming

Return true value

Version 7 AT&T UNIX

tsort

Text processing

Topological sort

Version 7 AT&T UNIX

tty

Misc

Return user's terminal name

Version 1 AT&T UNIX

type

Misc

Displays how a name would be interpreted if used as a command

ulimit

Misc

Set or report file size limit

umask

Misc

Get or set the file mode creation mask

System III

unalias

Misc

Remove alias definitions

uname

Misc

Return system name

PWB UNIX

uncompress

Misc

Expand compressed data

4.3BSD

unexpand

Text Processing

Convert spaces to tabs

3BSD

unget

SCCS

Undo a previous get of an SCCS file

System III

uniq

Text Processing

Report or filter out repeated lines in a file

Version 3 AT&T UNIX

unlink

Filesystem

Call the unlink function

Version 1 AT&T UNIX

uucp

Network

System-to-system copy

Version 7 AT&T UNIX

uudecode

Network

Decode a binary file

4BSD

uuencode

Network

Encode a binary file

4BSD

uustat

Network

uucp status inquiry and job control

System III

uux

Process Management

Remote command execution

Version 7 AT&T UNIX

val

SCCS

Validate SCCS files

System III

vi

Text processing

Screen-oriented (visual) display editor

1BSD

wait

Process Management

Await process completion

Version 4 AT&T UNIX

wc

Text processing

Line, word and byte or character count

Version 1 AT&T UNIX

what

SCCS

Identify SCCS files

PWB UNIX

who

System Administration

Display who is on the system

Version 1 AT&T UNIX

write

Misc

Write to another user's terminal

Version 1 AT&T UNIX

xargs

Shell Programming

Construct argument lists and invoke utility

PWB UNIX

yacc

C Programming

Yet another compiler compiler

PWB UNIX

zcat

Text Processing

Expand and concatenate data

4.3BSD

5. GNU packages

GNU packages

Name

Description

Provides

Version

bash

GNU's UNIX compatible shell

bash

4.2 (February 13, 2011)

coreutils

base commands

fileutils: chgrp,chown, chmod, cp, dd, df, dir, du,
ln, ls, mkdir, mkfifo, mknod, mv, rm, etc.

textutils: cat, cksum, head, tail, md5sum, nl, od,
pr, tsort, join, wc, tac, paste.

shellutils: basename, chroot, date, dirname, echo, env, groups,
hostname, nice, nohup, printf, sleep, etc.

8(January 20, 2016)

cpio

archiving program

cpio

2.11 (March 10, 2010)

diffutils

contains utilities to compare files

diff, cmp, diff3, sdiff

3.2 (September 2, 2011)

findutils

contains search utilities

find, locate, updatedb, xargs

4.4.2, (June 6, 2009)

finger

user information

n/a

1.37, (October 28, 1992)

grep

search for strings in files

grep

2.10, (November 16, 2011)

groff

document processing system (groff)

groff

1.22.2 (February 7, 2013)

GRUB

GRand Unified Bootloader

grub

2.00 (GRUB2) (June 27, 2012)

gzip

compression program (gzip)

gzip

1.7 (28 March 2016)

hurd

microkernel-based set of servers that perform the same function as a UNIX kernel

n/a

0.7, (October 31, 2015)

inetutils

useful utils for networking

ftp, telnet, rsh, rlogin, tftp

1.9, (December 31, 2011)

linux-libre

kernel that is maintained from modified versions of Linux to remove any software
that does not include its source code, has its source code obfuscated,
or is released under proprietary licenses

n/a

4.3, (November 2, 2015)

plotutils

useful utils for plotting to different devices

graph, libplot, libplotter

2.6, (September 27, 2009)

readline

useful library for reading command lines

readline

6.2 (February 14, 2011)

screen

a terminal multiplexer

screen

4.4.0 (June 19, 2016)

sysutils

system utilities to manage users, groups, passwords, shells

add-shell, chage, chfn, chgroup, chgrpmem,
chpasswd, chsh, chuser, cppw, expiry,
gpasswd, grpck, gshadow, hwclock, isosize,
last, lastlog, login, lsage, lsgroup,
lsuser, mkgroup, mkuser, nologin, passwd, pwck,
remove-shell, rmgroup, rmuser, setpwnam, vipw,
wall, write

请参考linux账号管理

0.1.6(2009)

tar

archiver able to create and handle file archives in various formats

tar

various (there are various tar implementations)

texinfo

documentation system for producing online and printed manuals

n/a

6.1 (February 6, 2016;)

time

program to determine the duration of execution of a particular command

time

1.7, (July 11, 1996)

6. Reference


CategoryTool

MainWiki: Unix_Utilities (last edited 2016-08-17 17:18:17 by twotwo)