Вы находитесь на странице: 1из 3

Linux Quick Reference

SOME USEFUL COMMANDS

Command

Task

Command

Task

File/Directory Basics

File Location

ls

List files

find

Locate files Locate files via index Locate commands Locate standard files

cp

Copy files

slocate

mv

Rename files

which

rm

Delete files

whereis

ln

Link files

cd

Change directory

File Text Manipulation

grep

pwd

Print current directory name

Search text for matching lines Extract columns Append columns Translate characters Sort lines Locate identical lines Copy stdin to a file and to stdout simultaneously

mkdir

Create directory

cut

rmdir

Delete directory

paste

 

tr

File Viewing

sort

cat

View files

uniq

less

Page through files

tee

head

View file beginning

tail

View file ending

File Compression

nl

Number lines

gzip

Compress files (GNU Zip) Compress files (Unix) Compress files (BZip2) Compress files (Windows Zip)

od

View binary data

xxd

View binary data

compress

gv

View Postscript/PDF files

bzip2

xdvi

View TeX DVI files

zip

File Creation and Editing

emacs

Text editor

File Comparison

vim

Text editor

diff

Compare files line by line Compare sorted files Compare files byte by byte Compute checksums

umask

Set default file protections

comm

cmp

soffice

Edit Word/Excel/ PowerPoint docs

md5sum

abiword

Edit Word documents

gnumeric

Edit Excel documents

Disks and Filesystems

 

df

Show free disk space Make a disk accessible Check a disk for errors Flush disk caches

File Properties

mount

stat

Display file attributes

fsck

wc

Count bytes/words/lines

sync

du

Measure disk usage

file

Identify file types

Backups and Remote Storage

touch

Change file timestamps

mt

Control a tape drive Back up a disk Restore a dump Read/write tape archives Burn a CD Mirror a set of files

chown

Change file owner

dump

chgrp

chmod

Change file group

Change file protections

restore

tar

chattr

Change advanced file attributes

cdrecord

rsync

lsattr

List advanced file attributes

©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- tered trademark of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473

of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473 www.oreilly.com

www.oreilly.com

Linux Quick Reference

SOME USEFUL COMMANDS

Command

Task

Command

Task

File/Directory Basics

File Location

ls

List files

find

Locate files Locate files via index Locate commands Locate standard files

cp

Copy files

slocate

mv

Rename files

which

rm

Delete files

whereis

ln

cd

Link files

Change directory

File Text Manipulation

pwd

Print current directory name

grep

Search text for matching lines Extract columns Append columns Translate characters Sort lines Locate identical lines Copy stdin to a file and to stdout simultaneously

mkdir

Create directory

cut

rmdir

Delete directory

paste

 

tr

File Viewing

sort

cat

View files

uniq

less

Page through files

tee

head

View file beginning

tail

View file ending

File Compression

nl

Number lines

gzip

Compress files (GNU Zip) Compress files (Unix) Compress files (BZip2) Compress files (Windows Zip)

od

View binary data

xxd

View binary data

compress

gv

View Postscript/PDF files

bzip2

xdvi

View TeX DVI files

zip

File Creation and Editing

emacs

Text editor

File Comparison

vim

Text editor

diff

Compare files line by line Compare sorted files Compare files byte by byte Compute checksums

umask

Set default file protections

comm

cmp

soffice

Edit Word/Excel/ PowerPoint docs

md5sum

abiword

Edit Word documents

gnumeric

Edit Excel documents

Disks and Filesystems

df

File Properties

mount

Show free disk space Make a disk accessible Check a disk for errors Flush disk caches

stat

Display file attributes

fsck

wc

Count bytes/words/lines

sync

du

Measure disk usage

file

touch

chown

Identify file types

Change file timestamps

Change file owner

Backups and Remote Storage

mt

dump

Control a tape drive

chgrp

chmod

chattr

Change file group

Change file protections

restore

tar

cdrecord

Back up a disk Restore a dump Read/write tape archives Burn a CD Mirror a set of files

Change advanced file attributes

rsync

lsattr

List advanced file attributes

©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- tered trademark of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473

trademarks are property of their respective owners. #30473 www.oreilly.com Linux Quick Reference SOME USEFUL COMMANDS

www.oreilly.com

Linux Quick Reference

SOME USEFUL COMMANDS

Command

Task

Command

Task

File/Directory Basics

File Location

ls

List files

find

Locate files Locate files via index Locate commands Locate standard files

cp

Copy files

slocate

mv

Rename files

which

rm

Delete files

whereis

ln

cd

Link files

Change directory

File Text Manipulation

pwd

Print current directory name

grep

Search text for matching lines Extract columns Append columns Translate characters Sort lines Locate identical lines Copy stdin to a file and to stdout simultaneously

mkdir

Create directory

cut

rmdir

Delete directory

paste

 

tr

File Viewing

sort

cat

View files

uniq

less

Page through files

tee

head

View file beginning

tail

View file ending

File Compression

nl

Number lines

gzip

Compress files (GNU Zip) Compress files (Unix) Compress files (BZip2) Compress files (Windows Zip)

od

View binary data

xxd

View binary data

compress

gv

View Postscript/PDF files

bzip2

xdvi

View TeX DVI files

zip

File Creation and Editing

emacs

Text editor

File Comparison

vim

Text editor

diff

Compare files line by line Compare sorted files Compare files byte by byte Compute checksums

umask

Set default file protections

comm

cmp

soffice

Edit Word/Excel/ PowerPoint docs

md5sum

abiword

Edit Word documents

gnumeric

Edit Excel documents

Disks and Filesystems

df

File Properties

mount

Show free disk space Make a disk accessible Check a disk for errors Flush disk caches

stat

Display file attributes

fsck

wc

Count bytes/words/lines

sync

du

Measure disk usage

file

touch

chown

Identify file types

Change file timestamps

Change file owner

Backups and Remote Storage

mt

dump

Control a tape drive

chgrp

chmod

chattr

Change file group

Change file protections

restore

tar

cdrecord

Back up a disk Restore a dump Read/write tape archives Burn a CD Mirror a set of files

Change advanced file attributes

rsync

lsattr

List advanced file attributes

©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- tered trademark of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473

trademarks are property of their respective owners. #30473 www.oreilly.com Linux Quick Reference SOME USEFUL COMMANDS

www.oreilly.com

Linux Quick Reference

SOME USEFUL COMMANDS

Command

Task

Command

Task

File/Directory Basics

File Location

ls

List files

find

Locate files Locate files via index Locate commands Locate standard files

cp

Copy files

slocate

mv

Rename files

which

rm

Delete files

whereis

ln

cd

Link files

Change directory

File Text Manipulation

pwd

Print current directory name

grep

Search text for matching lines Extract columns Append columns Translate characters Sort lines Locate identical lines Copy stdin to a file and to stdout simultaneously

mkdir

Create directory

cut

rmdir

Delete directory

paste

 

tr

File Viewing

sort

cat

View files

uniq

less

Page through files

tee

head

View file beginning

tail

View file ending

File Compression

nl

Number lines

gzip

Compress files (GNU Zip) Compress files (Unix) Compress files (BZip2) Compress files (Windows Zip)

od

View binary data

xxd

View binary data

compress

gv

View Postscript/PDF files

bzip2

xdvi

View TeX DVI files

zip

File Creation and Editing

emacs

Text editor

File Comparison

vim

Text editor

diff

Compare files line by line Compare sorted files Compare files byte by byte Compute checksums

umask

Set default file protections

comm

cmp

soffice

Edit Word/Excel/ PowerPoint docs

md5sum

abiword

Edit Word documents

gnumeric

Edit Excel documents

Disks and Filesystems

df

File Properties

mount

Show free disk space Make a disk accessible Check a disk for errors Flush disk caches

stat

Display file attributes

fsck

wc

Count bytes/words/lines

sync

du

Measure disk usage

file

touch

chown

Identify file types

Change file timestamps

Change file owner

Backups and Remote Storage

mt

dump

Control a tape drive

chgrp

chmod

chattr

Change file group

Change file protections

restore

tar

cdrecord

Back up a disk Restore a dump Read/write tape archives Burn a CD Mirror a set of files

Change advanced file attributes

rsync

lsattr

List advanced file attributes

©2004 O’Reilly & Associates, Inc. O’Reilly logo is a regis- tered trademark of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473

of O’Reilly & Associates, Inc. All other trademarks are property of their respective owners. #30473 www.oreilly.com

www.oreilly.com

Linux Quick Reference

SOME USEFUL COMMANDS

Command

Task

Printing

lpr

Print files

lpq

View print queue

lprm

Remove print jobs

Spelling Operations

look

Look up spelling

aspell

Check spelling interactively

spell

Check spelling in batch

Processes

ps

List all processes

w

List users’ processes

uptime

View the system load

top

Monitor processes

xload

Monitor system load

free

Display free memory

kill

Terminate processes

nice

Set process priorities

renice

Change process priorities

Scheduling Jobs

sleep

Wait for some time

watch

Run programs at set intervals

at

Schedule a job

crontab

Schedule repeated jobs

Hosts

uname

Print system information

hostname

Print the system’s hostname

ifconfig

Set/display network information

host

Look up DNS

whois

Look up domain registrants

ping

Check if host is reachable

traceroute

View network path to a host

www.oreilly.com
www.oreilly.com

Command

Task

Networking

ssh

Securely log into remote hosts Log into remote hosts Securely copy files between hosts Securely copy files between hosts Copy files between hosts GUI email client Text-based email client Minimal email client Web browser Text-only web browser Retrieve web pages to disk Read Usenet news Instant messaging/IRC Linux/Unix chat Send messages to a terminal Prohibit talk/write

telnet

scp

sftp

ftp

evolution

mutt

mail

mozilla

lynx

wget

slrn

gaim

talk

write

mesg

Audio and Video

grip

Play CDs and rip MP3s

xmms

Play audio files

cdparanoia

Rip audio

audacity

Edit audio

xcdroast

Burn CDs

cdparanoia Rip audio audacity Edit audio xcdroast Burn CDs Excerpted from Linux Pocket Reference

Excerpted from Linux Pocket Reference