首页 > 编程知识 正文

命令补全快捷键,linux命令补全tab

时间:2023-05-06 03:38:48 阅读:151964 作者:538

CTRL-透明屏幕,类似于clear命令

ctrl r -查找历史记录命令ctrl c=退出

ctrl k=删除从这里到末尾的所有内容

ctrl u=删除此处,然后开始所有内容

linux上的帮助命令: man,info,--help

[root@localhost ~]# man ls

cannotopenthemessagecatalog ' man ' for locale

' zh_CN.UTF-8 '

(NLSPATH=' ' )

Formatting page,please wait .

ls(1)用户

命令ls (1) )。

名字

ls-list目录内容

同步

ls [OPTION]. [FILE] .

[root@localhost ~]# info ls

File: coreutils.info,Node: ls

invocation,Next: dir

invocation,up:directo3

还原列表

10.1 ` ls ' :列表目录内容

=====================================

the ` ls '程序列表sinformationaboutfiles (ofany

type,including

directories ).Options and file arguments can be

交叉

arbitrarily,as usual。

[root@localhost ~]# ls --help

用法: ls [选项]. [文件] .

listinformationaboutthefiles (thecurrentdirectoryby

默认)。

sortentriesalphabeticallyifnoneof-cftuvsuxnor

- -短。

使用短选项时,长选项所需的参数也是必需的。

-a,

以--all .字符开头的项目什么都不隐藏

-A,

- -列出除--almost-all .和.之外的所有项目

如果要同时使用--author和-l,请列出每个文件的作者

-b、

--escape用八进制溢出序列表示不可打印的字符

我个人喜欢man这个命令。 有问题的话男人就一小撮。 --help中出现的文档是中文。 英语不好的朋友可以参考这个,但并不是所有的命令都有中文的帮助。

要退出帮助,请按快捷键q

昨天说明ls的时候,我弄丢了实用的命令。 今天补充了精明的糖豆。 ll

h,此命令使文件大小更易于查看

[root@localhost ~]# ll -h

共计76K

-rw----1路由路由96306-2808336047

anaconda-ks.cfg

rwxr-xr-x2 root root 4.0k 06-2808336054桌面

-rw-r----r----1路由路由35k06-2808:47

install.log

- rw-r-- r--1root root 4.5k 06-2808:44 install.log.syslog

drwxr-xr-x2 root root 4.0k 07-122:55 nihao

cd ~用户名进入该用户的主目录

[root@localhost wl]# pwd

/home/wl

[root@localhost wl]# cd ~wl

[root@localhost wl]# pwd

/home/wl

alias和unalias设置和取消命令别名

[root@localhost ~]# alias l=ls

[root@localhost ~]# l

anaconda-ks.cfgdesktopinstall.log install.log.syslog nihao

[root@localhost ~]# ls

anaconda-ks.cfgdesktopinstall.log install.log.syslog nihao

[root@localhost ~]# alias

>

alias cp='cp -i'

alias l='ls'

alias l.='ls -d .* --color=tty'

alias ll='ls -l --color=tty'

alias ls='ls --color=tty'

alias mv='mv -i'

alias rm='rm -i'

alias which='alias | /usr/美好的电灯胆/which --tty-only --read-alias

--show-dot --show-tilde'

[root@localhost ~]# unalias l

[root@localhost ~]# alias

alias cp='cp -i'

alias l.='ls -d .* --color=tty'

alias ll='ls -l --color=tty'

alias ls='ls --color=tty'

alias mv='mv -i'

alias rm='rm -i'

alias which='alias | /usr/美好的电灯胆/which --tty-only --read-alias

--show-dot --show-tilde'

[root@localhost ~]#

ls可以显示文件的大小,但是不能准确显示目录的大小,而du -sh则可以准确统计目录、文件的大小

[root@localhost ~]# ll -h

总计 76K

-rw------- 1 root root 963 06-28 08:47

anaconda-ks.cfg

drwxr-xr-x 2 root root 4.0K 06-28 08:54 Desktop

-rw-r--r-- 1 root root 35K 06-28 08:47

install.log

-rw-r--r-- 1 root root 4.5K 06-28 08:44 install.log.syslog

drwxr-xr-x 2 root root 4.0K 07-12 23:55 nihao

[root@localhost ~]# du -sh Desktop/

8.0K Desktop/

[root@localhost ~]# du -sh install.log

40K install.log

[root@localhost ~]# du -sh

2.7M .

touch还有一个功能,可以更新文件的时间,当然参数还有很多,这里只说一个

[root@localhost ~]# ll

总计 76

-rw------- 1 root root 963

06-28 08:47 anaconda-ks.cfg

drwxr-xr-x 2 root root 4096 06-28 08:54

Desktop

-rw-r--r-- 1 root root 35661 06-28 08:47 install.log

-rw-r--r-- 1 root root 4575 06-28 08:44

install.log.syslog

drwxr-xr-x 2 root root 4096 07-12 23:55

nihao

[root@localhost ~]# touch install.log

[root@localhost ~]# ll

总计 76

-rw------- 1 root root 963

06-28 08:47 anaconda-ks.cfg

drwxr-xr-x 2 root root 4096 06-28 08:54

Desktop

-rw-r--r-- 1 root root 35661 07-13 23:52 install.log

-rw-r--r-- 1 root root 4575 06-28 08:44

install.log.syslog

drwxr-xr-x 2 root root 4096 07-12 23:55

nihao

file查看文件属性

[root@localhost ~]# file test.txt

test.txt: ASCII text

[root@localhost ~]# file /etc/passwd

/etc/passwd: ASCII text

whereis定位文件位置命令

[root@localhost ~]# whereis test.txt

test: /usr/美好的电灯胆/test /usr/share/man/man1/test.1.gz

/usr/share/man/man1p/test.1p.gz

[root@localhost ~]# whereis ls

ls: /美好的电灯胆/ls /usr/share/man/man1/ls.1.gz

/usr/share/man/man1p/ls.1p.gz

wc统计指定文件中的字节数、字数、行数, 并将统计结果显示输出

[root@localhost ~]# wc -l test.txt

1 test.txt

[root@localhost ~]# wc -c test.txt

12 test.txt

[root@localhost ~]# wc -w test.txt

2 test.txt

[root@localhost ~]#

用户配置文件:~/.bashrc ~/.bash_profile ~/.bash_logout

全局配置文件:/etc/profile /etc/bashrc

这几个文件,我就不在这里讨论了,我打算明天早上早点起来独立一篇文章专门讲。另外vi由于篇幅比较大,所以说明天可能的话,也于明天独立一篇文章出来。现在时间还是比较紧的,我的效率应该好好提高一点。

history 查看命令的历史记录

[root@localhost ~]# history

1 clear

2 info ls

3 ls -h

4 clear

5 ll -h

6 clear

7 cd ~wl

8 clear

9 pwd

10 cd

~wl

11 pwd

12 cd

13 clear

history –c 清除命令的历史记录

[root@localhost ~]# history

1 clear

2 info ls

3 ls -h

4 clear

5 ll -h

6 clear

7 cd ~wl

8 clear

9 pwd

10 cd ~wl

11 pwd

12 cd

13 clear

[root@localhost ~]# history -c

[root@localhost ~]# history

1 history

另外有个快捷键,ctrl+r可以查找历史命令

which 查找文件命令

[root@localhost ~]# which

ls

alias ls='ls

--color=tty'

/美好的电灯胆/ls

[root@localhost ~]# which

passwd

/usr/美好的电灯胆/passwd

[root@localhost ~]# which

useradd

/usr/s美好的电灯胆/useradd

passwd 修改用户密码

[root@localhost ~]#

passwd

Changing password for user

root.

New UNIX password:

Retype new UNIX

password:

passwd: all authentication tokens

updated successfully.

[root@localhost ~]# passwd

wl

Changing password for user

wl.

New UNIX password:

BAD PASSWORD: it is based on a

dictionary word

Retype new UNIX

password:

passwd: all authentication tokens

updated successfully.

passwd不加用户名,修改的是当前用户的密码,加了用户名就是修改指定用户的密码。

[root@localhost ~]# passwd -l

wl 锁住用户

Locking password for user

wl.

passwd: Success

[root@localhost ~]# passwd -S

wl 查看账户状态

wl LK 2011-07-13 0 99999 7 -1

(Password locked.)

[root@localhost ~]# passwd -u

wl 给用户解锁

Unlocking password for user

wl.

passwd: Success.

[root@localhost ~]# passwd -S

wl

wl PS 2011-07-13 0 99999 7 -1

(Password set, MD5 crypt.)

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。