您的位置:首页 > 其它

ubuntu常见基础应用(快捷键,常见命令,man命令)

2014-09-14 21:09 453 查看
一.常用快捷键:

1.erasing a character -----backspac

2.delete a word -----ctral + w

3.delete a line ---------------ctral + x或者ctral + u

4.move to line front or line end ----tral +x

4.terminate(终止) a running program ----ctral + c或者 ctral+ z 或者kill命令

二.命令:

1.apropos searches for a keyword------apropos 或者whatis

the whatis utility is similar to apropos but finds olny complete word matches for the name of the utility.

2.howtos finding out how things work -----/usr/share/doc或者/usr/src/linux/Documentation

三.basic utilities:

(1).

1.ls ---lists the names of files

2.cat ---displays a text file

3.rm ----delete a file

4.less ls more ----display a text file one screen at a time

5.hostname ----display the system name

6.cp -----copis a file

7.mv -----changes the name of a file or move to another place

8.lpr ---prints a file

9.grep ----searches for a string keyword

10.head ----display the beginning of a file

11.tail ----display the end of a file

12.sort ----display a file in order

13.uniq ----remove duplicate lines from a file

14.diff----compares two files

15.file----identifies the contents of a file

16.|-----communicates bettween processes

17.echo----display text

18.date----display the time and date

19.script-----records a shell session

(1).

******compresses or packagee files

20.bzip2/bunzip2/bzcat------compresses a file or decompress a file or display a file that has been compressed with bzip2

gzip/gunzip/zcat ----------compress a file or decompress a file or display a file that has been compressed with gzip

tar------to create a single file ( called a tar file,archive,ortarball ) form multiple files or directory hierarchies and to extract files from a tar file (打包软件)

打包以后用bzip2,compress,or gzip压缩tar软件包

用bzip2压缩后叫.tar.bz2 or .tbz or;用gzip压缩后叫.tar.gz or .tgz or .gz; 用compress压缩的叫.tar.Z

(2).

****location files---- 文件路径查找:

21.

slocate(secure locate)/locate
功能说明:查找文件或目录。
语 法:slocate [-u][--help][--version][-d <目录>][查找的文件]
补充说明:slocate本身具有一个数据库,里面存放了系统中文件与目录的相关信息。

*****location commands --命令路径查找:
23.
which

locate utilities by displaying the full pathname of the file for the utility.

说明:就是找出命令的执行文件的目录路径。

which是通过 PATH环境变量到该路径内查找可执行文件,所以基本的功能是寻找可执行文件

24.

whereis

searches for files relate to a utility by looking in standard location instead of using your search path

找到程序的源、二进制文件或手册。(将所有相关的文件都查找出来)。

(3).

*****obtainning user and system information

To find out who is using the local system,you can employ one of several utilities that vary in the details they provide the option they support. The oldest utility

who ,produces a list of users who are logged in on the local system,the device each person is using ,and the time each person logged in.

The w and finger utilites show more details , such as users full name and the command line each user is running.you can use the finger utility to retrieve information

about users on remote systems if the local system is attached to a network.

(4).

*****communication with other users

25.

write

26.

mesg-------denies or acceptes messages

mesg y:if xx had not given this commmad before yy tried to send xx a message. yy might have seen the following message:

write xx

write : yy has messages disabled

mesg n:if you have messages blocked and you wirte to another user,write display the following messages.

write xx:

write:write: you have write permission turned off.

27.

email -----sent message to someone around the world.

四.man命令:

linux man的常用用法:

man section cmd :直接指定特定章节内搜索手册页,如man 5 passwd 直接进入文件格式版的帮助

man -a cmd :打开所有section内的同名帮助,例如 man –a passwd ,你首先会进入一个PASSWD(1)的命令版passwd帮助,你再按q键就会进入PASSWD(5),passwd配置文件格式的帮助

man -aw cmd :显示所有cmd的所有手册文件的路径,如 man -aw passwd 就是

/usr/share/man/man1/passwd.1.gz

/usr/share/man/man5/passwd.5.gz

man -M cmd :指定手册文件的搜索路径,如 man -M /home/mysql/man mysql 显示的就是你安装的mysql的帮助,而不是系统自带的旧版mysql的帮助

man cmd| col -b > cmd.txt :把man手册信息输出到文本文件

man简单介绍:

Linux的man很强大,该手册分成很多section,使用man时可以指定不同的section来浏览,各个section意义如下:

1 – User Commands 一般用户命令
2 - System Calls 系统调用命令,如open,write之类的(通过这个,至少可以很方便的查到调用这个函数,需要加什么头文件)
3 - C library Functions C函数库命令,如printf,fread
4 - Devices and Special files 是特殊文件,也就是/dev下的各种设备文件
man hd
5 - File formats and conventions 是指文件的格式,比如man 5 passwd, 就会得到说明这个文件/etc/passwd中各个字段的含义
6 - games for linux是给游戏留的,由各个游戏自己定义
7 - Miscellanea 杂项, 例如宏命令包、惯例等。
8 - System administration tools and Deamons 是系统管理用的命令,这些命令只能由root使用,如ifconfig
9 -其他(Linux特定的), 用来存放内核例行程序的文档。
n 新文档, 可能要移到更适合的领域。
o 老文档, 可能会在一段期限内保留。
l 本地文档, 与本特定系统有关的。

man命令格式:

man [option] name: name一般是帮助文档的名字,对应命令名、函数名或者配置文件名(带后缀!),如

man nsswitch.conf:查看/etc/nsswitch.conf文件的帮助文档

man networks:查看/etc/sysconfig/networks文件的帮助文档

查看特定语言版的帮助文档:先设定环境变量LANG=zh_CN,然后再执行man查询

man的配置文件/etc/man.config:

如果你不想每次man cmd都要用-M指定路径,那么可以通过修改配置文件,添加内容如

MANPATH /home/mysql/man

五.管道及重定向

这部分很简单,大家仔细看看就明白了。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: