我注意到主题行中引用的文件夹占用了 1.5 GB。我可以运行以下命令来清除它而不会对我的系统造成永久性损坏吗?
rm -rf /var/cache/PackageKit/metadata/updates/packages/*
Run Code Online (Sandbox Code Playgroud) 我可以 ping google.com几秒钟,当我按Ctrl+时C,底部会显示一个简短的摘要:
$ ping google.com
PING google.com (74.125.131.113) 56(84) bytes of data.
64 bytes from lu-in-f113.1e100.net (74.125.131.113): icmp_seq=2 ttl=56 time=46.7 ms
64 bytes from lu-in-f113.1e100.net (74.125.131.113): icmp_seq=3 ttl=56 time=45.0 ms
64 bytes from lu-in-f113.1e100.net (74.125.131.113): icmp_seq=4 ttl=56 time=54.5 ms
^C
--- google.com ping statistics ---
4 packets transmitted, 3 received, 25% packet loss, time 3009ms
rtt min/avg/max/mdev = 44.965/48.719/54.524/4.163 ms
Run Code Online (Sandbox Code Playgroud)
但是,当我使用 执行相同的重定向输出到日志文件时tee,不会显示摘要:
$ ping google.com | tee log
PING google.com (74.125.131.113) 56(84) …Run Code Online (Sandbox Code Playgroud) 我正在尝试top使用-p选项 和来运行多个 PID xargs。但是,top无法运行并出现错误top: failed tty get:
$ pgrep gvfs | paste -s -d ',' | xargs -t top -p
top -p 1598,1605,1623,1629,1635,1639,1645,1932,2744
top: failed tty get
Run Code Online (Sandbox Code Playgroud)
我使用-t选项来xargs查看即将执行的完整命令。看起来不错,我可以手动成功运行它:
top -p 1598,1605,1623,1629,1635,1639,1645,1932,2744
Run Code Online (Sandbox Code Playgroud)
但是,它不与 一起运行xargs。这是为什么?
当我迭代 bash 历史记录中的先前命令时,光标位置始终跳转到命令末尾。我想要某种方法来记住上次执行命令的当前光标位置。
当为某些命令尝试不同的命令行选项时,这可能很有用。现在我必须按up键并将光标向后移动到键入选项的位置才能对其进行编辑。如果可能的话,我想消除第二步。
我使用的是 bash,但其他 shell 的解决方案也很有趣。