当我在 ubuntu 12.04 中登录 shell 时,我总是可以看到此消息
Welcome to Ubuntu 12.04.1 LTS (GNU/Linux 3.2.0-29-generic x86_64)
* Documentation: https://help.ubuntu.com/
System information as of Wed Dec 19 13:41:52
System load: 0.73 Processes: 133
Usage of /: 37.5% of 81.73GB Users logged in: 0
Memory usage: 3%
Swap usage: 5%
Graph this data and manage this system at https://landscape.canonical.com/
Last login: Wed Dec 19 13:36:52 2012 from
Run Code Online (Sandbox Code Playgroud)
哪里可以找到脚本?
注意:我已经看过了
但我还没有找到
我正在尝试在 SUSE10 机器上从源代码构建 mosh 并收到以下错误:
checking for protobuf... no
configure: error: Package requirements (protobuf) were not met:
No package 'protobuf' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables protobuf_CFLAGS
and protobuf_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
Run Code Online (Sandbox Code Playgroud)
我将源代码下载到 protobuf 并将其安装在自定义路径中。我没有为此使用包管理器,也不能出于问题范围之外的各种原因。我将该自定义路径添加到我的 PATH 并重新哈希。通常,这对于配置来说已经足够了,但在这种情况下,它不起作用。我将 protobuf 的前缀添加到 PKG_CONFIG_PATH 但仍然遇到此错误。
接下来我应该怎么做才能克服这个错误?
我想默认保存 Unix 格式,无论它是新文件还是不同格式的现有文件。
我想打开一个简单的windows格式文件添加一个额外的句子,当我保存时我希望文件以默认的Unix格式保存而不是我明确地进行eol更改是否有办法做到这一点
我有一个分区被安装为noexec. 它显示在mount输出上,但没有任何东西fstab可以做到这一点。
是从哪里来noexec的?
我的文件系统表:
UUID=1fbb29fe-cef2-4cc2-9b1e-ac45e74289ac / ext4 noatime,nodiratime,errors=remount-ro 0 1
# swap was on /dev/sda3 during installation
UUID=some-uuid-string none swap sw 0 0
/dev/sr0 /media/cdrom0 udf,iso9660 user,noauto 0 0
tmpfs /tmp tmpfs nodev,nosuid,noexec,size=2G 0 0
# old disks
#/dev/md0 /DATA ext4 noauto,nodiratime,errors=remount-ro,user 0 2
# new disks:
/dev/md1 /DATA ext4 noauto,nodiratime,errors=remount-ro,user 0 2
Run Code Online (Sandbox Code Playgroud)
我以用户或 root 身份挂载上面的 /DATA 分区。无论哪种情况我都会得到:
/dev/md1 on /DATA type ext4 (rw,nosuid,nodev,noexec,nodiratime,relatime,errors=remount-ro,stripe=16384,data=ordered,user)
Run Code Online (Sandbox Code Playgroud) 我对此进行了一些谷歌搜索(可能是不正确的关键字),但我没有找到如何做到这一点。
考虑以下命令:
useradd -s /bin/bash -m user1
useradd -s /bin/bash -m user2
useradd -s /bin/bash -m user3
Run Code Online (Sandbox Code Playgroud)
我希望以这种方式创建的任何新用户也可以添加到名为 的组中test,但不需要每次运行时都指定它useradd。我希望这种情况默认发生。
我的意思是创建后user1,当我运行时grep user1 /etc/group,它应该分为两组:test和user1。
那可能吗?我正在使用 CentOS。
我想知道是否可以将单个文件复制到具有不同参数列表的多个文件。我有一个通用图像,我需要制作它的多个副本,为每个副本添加不同的国家/地区扩展名。
我乐观地尝试:
cp -r centre-stage-synopsis.jpg centre-stage-synopsis-{en_US,fr_FR,de_DE,da_DK,ru_RU,pt_BR,ro_RO,hu_HU,el_GR,it_IT}.jpg
Run Code Online (Sandbox Code Playgroud)
但它不起作用。有没有办法一次性做到这一点?
干杯
我没有 Linux 经验,我所知道和想做的就是:
我的本地计算机上有一个 JAR 文件,我想将其复制到远程机器上。我认为它是一个 Linux 机器,我使用 ssh 连接到它,如下所示:
ssh myUserName@boxName
Run Code Online (Sandbox Code Playgroud)
然后我输入我的密码并连接到它。
现在我只想将本地文件从我的机器复制到那个远程盒子。
我对 shell 脚本知之甚少,但不幸的是我必须编写一个。我想问一下bash脚本迭代移动文件,我需要移动按月排序的日志文件,这些文件将由cronjob执行。计划是将 mtime +30(1 个月前)文件移动到几个文件夹中,cronjob 将每天执行,例如:
/home/Work/LogFiles/20131200012.log
/home/Work/LogFiles/thisLogIsDifferent.log
/home/Work/LogFiles/20120322222.log
/home/Work/LogFiles/20140100011.log
/home/Work/LogFiles/thisLogIsDifferent2.log
Run Code Online (Sandbox Code Playgroud)
/home/Work/LogFiles/thisLogIsDifferent.log
/home/Work/LogFiles/thisLogIsDifferent2.log
/home/Work/LogFiles/2013/DEC/20131200012.log
/home/Work/LogFiles/2012/MAR/20120322222.log
/home/Work/LogFiles/2014/JAN/20140100011.log
Run Code Online (Sandbox Code Playgroud)
我对我必须使用的方法一无所知。所以这是我糟糕的 shell 脚本:
BASE_DIR=/home/Work/LogFiles
REPORT_DIR_YEAR=$BASE_DIR/`date +%Y`
REPORT_DIR=$REPORT_DIR_YEAR/`date +%b`
NOW=$(date +"%Y%m")
if ! [ -d $REPORT_DIR_YEAR ]; then
mkdir $REPORT_DIR_YEAR
if ! [ -d $REPORT_DIR ]; then
mkdir $REPORT_DIR
fi
fi
#THIS PART NEED TO BE RE-ARRANGED
#What I expect is not date=NOW; BUT SOME KIND LIKE date %m-1? but I still don't have any ideas about modify date function.
for file …Run Code Online (Sandbox Code Playgroud) 为什么我可以 ssh 到另一台服务器,但是当我尝试 ssh 但它进入超时并失败时?
ubi@xserver: ssh lil@yserver
Password:
Last login: Thu Jan 30 16:10:39 2014 from xserver
lil@yserver:~> ssh ubi@xserver
_
Run Code Online (Sandbox Code Playgroud)
我试过 ssh 选项,-A但它不起作用:
lil@yserver:~ # ssh -A ubi@xserver
^C
Run Code Online (Sandbox Code Playgroud)
ssh 守护进程正在运行:
lil@yserver:~ # rcsshd reload
Reload service sshd
done
lil@yserver:~ # rcsshd restart
Shutting down the listening SSH daemon
done
Starting SSH daemon
done
lil@yserver:~ # ssh ubi@xserver
^C
Run Code Online (Sandbox Code Playgroud) linux ×6
bash ×2
compile ×1
connection ×1
duplicate ×1
expansion ×1
ext4 ×1
mac ×1
macos ×1
mount ×1
networking ×1
notepad++ ×1
partitioning ×1
shell-script ×1
ssh ×1
suse ×1
ubuntu ×1
zsh ×1