Questions tagged «command-line»

有关使用命令行界面(CLI)的问题。


7
如何在Bash提示中用颜色显示git分支?
在git存储库中工作时,我正在使用本指南在gnome终端(Ubuntu 15.10)中显示分支名称。基于以上内容,我现在在〜/ .bashrc文件中具有以下内容: # uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes ... # Add git branch if …
107 command-line  bash  git 

7
无法执行.sh文件:/ bin / bash ^ M:错误的解释器
我想执行一个shell脚本: -rwxr-x--x 1 root root 17234 Jun 6 18:31 create_mgw_3shelf_6xIPNI1P.sh 我尝试执行标准过程,但出现此错误: ./create_mgw_3shelf_6xIPNI1P.sh localhost 389 -l /opt/fews/sessions/AMGWM19/log/2013-06-06-143637_CLA-0 DEBUG cd/etc/opt/ldapfiles/ldif_in ; ./create_mgw_3shelf_6xIPNI1P.sh localhost 389 -l /opt/fews/sessions/AMGWM19/log/2013-06-06-143637_CLA-0 **ERROR sh: ./create_mgw_3shelf_6xIPNI1P.sh: /bin/bash^M: bad interpreter: No such file or directory** 这是什么意思?我是root该root小组的用户。 这是否意味着该文件没有root用户的正确权限?



2
如何将终端标准输出(stdout)传送到剪贴板?
例如, 假设我要列出文件夹的内容,然后将其直接粘贴到聊天窗口中,以供朋友查看。 我意识到我可以ls > filename.txt用这些内容创建一个文件(filename.txt)。然后,我不得不打开或打印文件,然后手动选择并复制文本块(这可能很烦人/繁琐。)显然,我也可以ls直接从终端窗口中选择并复制输出。 只需将标准输出通过管道传输到剪贴板,将会更快/更容易。 什么终端命令允许我执行此操作?


3
在终端命令提示符下更改用户,主机,目录信息的颜色
是否可以在命令提示符中更改的颜色user@computer,以及提示符显示的当前目录和命令部分的颜色? 我已经看过OSX用户所做的类似事情,但是我不知道如何在gnome终端中做同样的事情(我只能更改前景色和背景色)。 例如,在尝试编译有错误的程序时,这将非常有用,因为长而未格式化的消息使您很难区分哪些行是命令,哪些行是输出。

8
如何使用命令行轻松重命名多个文件?
我在Windows中快速重命名文件的方法之一是 F2 > Rename > Tab (to next file) > Rename ... 但是在Ubuntu / Nautilus中,我无法跳至下一个文件。但是在Linux上,我认为必须有命令行替代方案。 但是,有时,我可能希望对如何重命名特定文件有更多控制。在这种情况下,最好能跳至下一个文件







By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.