我有一个目录,其中有许多同名文件(大约 200 个)与temp_log.$$其他几个我需要检查的重要文件一起创建。
如何轻松列出所有文件并temp_log.$$从显示中排除文件?
$ ls -lrt <exclude-filename-part>
-- Lists files not matching the above given string
Run Code Online (Sandbox Code Playgroud)
我浏览了ls手册页,但在此参考中找不到任何内容。如果我在这里遗漏了任何重要信息,请告诉我。
谢谢
当一次拖尾多个文件时,如下所示,有没有办法在每行的开头显示文件名?
tail -f one.log two.log
Run Code Online (Sandbox Code Playgroud)
电流输出
==> one.log <==
contents of one.log here...
contents of one.log here...
==> two.log <==
contents of one.log here...
contents of two.log here..
Run Code Online (Sandbox Code Playgroud)
寻找类似的东西
one.log: contents of one.log here...
one.log: contents of one.log here...
two.log: contents of two.log here...
two.log: contents of two.log here...
Run Code Online (Sandbox Code Playgroud) 我在这里阅读了有关如何更新 vim 状态行的信息。我能够成功更新它。
但是,我想保留默认 vim 状态行的格式,并为其添加更多信息,例如文件大小、文件类型等。
Vim 默认状态行是:
<file-name> line_num,col_num %file
Run Code Online (Sandbox Code Playgroud)
我怎么能做到以下几点?
:set statusline显示任何内容)我试过:
set statusline+=%y
Run Code Online (Sandbox Code Playgroud)
但这会覆盖整个状态行并仅显示文件类型 ( %y)。
任何提示?
我仅使用虚拟化将 OpenBSD 安装到裸机上,并且在安装过程中,没有配置到串行端口的重定向,因此,我最终使系统运行,但无法登录并进行清理关掉。
kvm -m 6144 -smp 4 -drive file=/dev/sda,if=ide \
-drive file=/dev/sdb,if=scsi -drive file=/dev/sdc,if=scsi \
-cdrom install52.iso -boot d -nographic
Run Code Online (Sandbox Code Playgroud)
如何向此会话发送关闭事件?AFAIK,Ctrl-a x如此处所示,否则pkill kvm还不会完全关闭。
或者,如何从-nographic模式切换到-curses模式?
我在我的.bashrc文件中设置了几个功能。我只想显示函数的实际代码而不执行它,以便快速引用某些内容。
有什么办法,我们可以看到函数定义?
我不想评论文本文件或代码中的文本行。我正在寻找在.vimrc文件中插入块注释。插入单行注释"使用,例如:
" remove spaces and tabs as well at the end of line automatically while saving
autocmd BufWritePre * :%s/\s\+$//e
Run Code Online (Sandbox Code Playgroud)
现在,我在浏览 Internet 以添加很酷的功能后,多年来收集了相对大量的设置/配置/插件。我希望在我的 .vimrc 文件中添加一些大的注释块。添加"到每一行是一个选项,但我正在寻找块注释语法。类似于/**/C.
//等同于"
/* */等同于_ ____?
搜索 Unix.SE、SO 和谷歌搜索并没有多大帮助。
有什么作用-9?
它没有出现在语法中:
$ kill
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
$
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用grep. 目录中有很多文件(> 500)
$ grep 'delete' *
Run Code Online (Sandbox Code Playgroud)
validate_data_stage1:0
validate_data_stage2:0
validate_data_stage3:0
validate_data_stage4:0
validate_data_stage5:0
validate_input_stage1:0
validate_input_stage2:0
validate_input_stage3:0
validate_input_stage4:0
.... and hundred of such lines
Run Code Online (Sandbox Code Playgroud)
这些是不包含给定匹配项的文件。我想抑制这些行显示到标准输出。我知道-qswitch,但这会抑制我不想要的完整输出。
我怎么做?
我想隐藏光标,我知道tput命令。我确实搜索了它的手册页。在网上搜索,我发现
$ tput civis # to hide the cursor
$ tput cnorm # to bring back the cursor
Run Code Online (Sandbox Code Playgroud)
这些工作完美,但这些选项在手册页的任何地方都没有提到。
他们在哪里正式记录?