linux系统下怎么退出界面命令,linux:命令行中对文件进行编辑后怎么退出到命令行界面...

匿名用户

1级

2012-11-14 回答

如果在命令行下使用gedit, 关闭程序窗口(一般先保存文件),就自动退到命令行界面。

如果在命令行下使用vim,先按下ESC退出编辑模式,然后输入:wq 保存并退出或者q退出或者q!强制退出,从而回到命令行界面。

d7bfd47748233aadde05c7a2a98c9857.png

扩展资料:

linux常见命令:

命令

apropos whatis    显示和word相关的命令。 参见线程安全

man -t man | ps2pdf - > man.pdf    生成一个PDF格式的帮助文件

which command    显示命令的完整路径名

time command    计算命令运行的时间

time cat    开始计时. Ctrl-d停止。参见sw

nice info    运行一个低优先级命令(这里是info)

renice 19 -p $$    使脚本运行于低优先级。用于非交互任务。

目录操作

cd -    回到前一目录

cd    回到用户目录

(cd dir && command)    进入目录dir,执行命令command然后回到当前目录

pushd .    将当前目录压入栈,以后你可以使用popd回到此目录

文件搜索

alias l='ls -l --color=auto'    单字符文件列表命令

ls -lrt    按日期显示文件. 参见newest

ls /usr/bin | pr -T9 -W$COLUMNS    在当前终端宽度上打印9列输出

find -name '*.[ch]' | xargs grep -E 'expr'    在当前目录及其子目录下所有.c和.h文件中寻找'expr'. 参见findrepo

find -type f -print0 | xargs -r0 grep -F 'example'    在当前目录及其子目录中的常规文件中查找字符串'example'

find -maxdepth 1 -type f | xargs grep -F 'example'    在当前目录下查找字符串'example'

find -maxdepth 1 -type d | while read dir; do echo $dir; echo cmd2; done    对每一个找到的文件执行多个命令(使用while循环)

find -type f ! -perm -444    寻找所有不可读的文件(对网站有用)

find -type d ! -perm -111    寻找不可访问的目录(对网站有用)

locate -r 'file[^/]*\.txt'    使用locate 查找所有符合*file*.txt的文件

look reference    在(有序)字典中快速查找

grep --color reference /usr/share/dict/words    使字典中匹配的正则表达式高亮

归档 and compression

gpg -c file    文件加密

gpg file.gpg    文件解密

tar -c dir/ | bzip2 > dir.tar.bz2    将目录dir/压缩打包

bzip2 -dc dir.tar.bz2 | tar -x    展开压缩包 (对tar.gz文件使用gzip而不是bzip2)

tar -c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg'    目录dir/压缩打包并放到远程机器上

find dir/ -name '*.txt' | tar -c --files-from=- | bzip2 > dir_txt.tar.bz2    将目录dir/及其子目录下所有.txt文件打包

find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parents    将目录dir/及其子目录下所有.txt按照目录结构拷贝到dir_txt/

( tar -c /dir/to/copy ) | ( cd /where/to/ && tar -x -p )    拷贝目录copy/到目录/where/to/并保持文件属性

( cd /dir/to/copy && tar -c . ) | ( cd /where/to/ && tar -x -p )    拷贝目录copy/下的所有文件到目录/where/to/并保持文件属性

( tar -c /dir/to/copy ) | ssh -C user@remote 'cd /where/to/ && tar -x -p'    拷贝目录copy/到远程目录/where/to/并保持文件属性

dd bs=1M if=/dev/sda | gzip | ssh user@remote 'dd of=sda.gz'    将整个硬盘备份到远程机器上

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值