我尝试使用相对路径创建带有 tar 的存档。我使用以下命令:
tar czf ~/files/wp/my-page-order.tar.gz -C ~/webapps/zers/wp-content/plugins/ ~/webapps/zers/wp-content/plugins/my-page-order
Run Code Online (Sandbox Code Playgroud)
但是归档文件仍然具有绝对路径。如何将 tar 与相对路径一起使用?
通过ps
命令,我可以找出每个程序使用了多少内存:
ps -u mertnuhoglu -o pcpu,rss,pid,command
Run Code Online (Sandbox Code Playgroud)
是否也可以轻松找出每种类型的资源使用量的总和?
使用set -x
会导致我的 shell 打印不相关的东西。例如:
$ set -x
++ printf $'%157s\r'
$ echo 'hello'
+ echo hello
hello
++ printf $'%157s\r'
Run Code Online (Sandbox Code Playgroud)
以“++”开头的行是额外的。我怎样才能删除那些多余的行?
我想使用tree
命令列出目录的子目录。但我不想打印缩进线。我只想用空格代替。
我在手册页中找不到正确的参数。也许我可以通过管道输出tree
tosed
来删除这些行。