我想搜索所有.conf的文件/etc/。
我试过了grep -r *.conf /etc,但结果不对。
我究竟做错了什么?
我想使用 显示自上次系统启动以来经过的时间uptime,但我不希望它显示所有信息。我只想知道自上次系统启动以来经过了多少小时(即:18:17:59)
如何将所有以“b”或“B”开头的文件从 /bin 复制到特定文件夹?
我试过了cp /bin* b,但我没有成功。
我知道这是一个愚蠢的问题,但是由于我自己非常努力地学习 linux,所以我需要你们的帮助。
我在互联网上找到了这个任务,我正在尝试解决它,但我不明白如何在 linux 中使用 makefile 以及如何创建它们。
假设我的打印工作目录是 /home/george/Documents
我想创建一个执行以下操作的 makefile:
date在这个 make 文件中使用命令来显示前三个字母。敷/etc/hosts在/tmp使用gzip(这里大概应该是这样的
gzip -c SOURCE DESTINATION # ??
Run Code Online (Sandbox Code Playgroud)干杯
我试图使用“日期”仅显示当前时间,而不是所有的信息日、月、年等,仅显示当前时间。
IE:
下午 13:45 或 1:45
有任何想法吗?
我试图从一个名为 input.txt 的 txt 文件中将每个句子中第一个单词的每个首字母大写,我希望这个输入文件成为 shell 脚本的参数
./script.sh input.txt
Run Code Online (Sandbox Code Playgroud)
示例输入文件:
i am Andrew. you are Jhon. here we are, forever.
Run Code Online (Sandbox Code Playgroud)
结果文件:
I am Andrew. You are Jhon. Here we are, forever.
Run Code Online (Sandbox Code Playgroud)
一个特例。如果我们的文本是(与@RaduRadeanu 答案相关)怎么办
i am andrew. you
are jhon. here we are
forever
Run Code Online (Sandbox Code Playgroud)
结果将是:
I am andrew. You
Are jhon. Here we are
Forever.
Run Code Online (Sandbox Code Playgroud)
所以它将每个句子的每个第一个单词以及换行的每个第一个单词转换为大写。我们如何跳过新行的大写第一个单词?
所以正确的结果应该是:
I am andrew. You
are jhon. Here we are
forever.
Run Code Online (Sandbox Code Playgroud)
如果句子以“?”结束怎么办?或者 ”!” ???
如何创建一个接收向量参数的 shell 脚本,如
./script.sh google.com,yahoo.com
并显示每个域的 ip
像 google.com 100.23.123.13
编辑:
#!/bin/bash
while [ "$1" ];
do
host $1 | grep address | head -1
done
Run Code Online (Sandbox Code Playgroud) 我在运行 Ubuntu Linux 14.04 的服务器上安装了 ProFTPd 服务。我不知道为什么 ProFTPd 会自行关闭。我有足够的 RAM 和 CPU,但我真的不知道为什么会发生这种情况。我还检查了 ProFTPd 配置文件,但我仍然不明白。
# /etc/proftpd/proftpd.conf -- This is a basic ProFTPD configuration file.
# To really apply changes, reload proftpd after modifications, if
# it runs in daemon mode. It is not required in inetd/xinetd mode.
#
# Includes DSO modules
Include /etc/proftpd/modules.conf
# Set off to disable IPv6 support which is annoying on IPv4 only boxes.
UseIPv6 on
# If set on you can experience a longer connection …Run Code Online (Sandbox Code Playgroud)