小编Bla*_*Cat的帖子

如何一步复制并添加文件名前缀?

我想复制和重命名一个目录中的多个 c 源文件。

我可以这样复制:

$ cp *.c $OTHERDIR
Run Code Online (Sandbox Code Playgroud)

但我想给所有文件名一个前缀:

file.c --> old#file.c
Run Code Online (Sandbox Code Playgroud)

我怎样才能在 1 步中做到这一点?

bash cp file-copy

12
推荐指数
2
解决办法
4万
查看次数

利用漏洞时未设置HOME

我有一个错误 sh: line 61: cd: HOME not set。

在此处输入图片说明

发行版:Metasploitable 2 (Ubuntu 8.04)

/root/.bashrc (删除了注释和空格):

[ -z "$PS1" ] && return
shopt -s checkwinsize
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
if [ -z "$debian_chroot" -a -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
fi
case "$TERM" in
xterm-color)
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
;;
*)
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    ;;
esac
case "$TERM" in
xterm*|rxvt*)
    PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD/$HOME/~}\007"'
    ;;
*)
    ;;
esac
if [ "$TERM" != "dumb" ]; then
    eval "`dircolors -b`"
    alias ls='ls --color=auto'
fi …
Run Code Online (Sandbox Code Playgroud)

environment-variables home

2
推荐指数
1
解决办法
6646
查看次数

标签 统计

bash ×1

cp ×1

environment-variables ×1

file-copy ×1

home ×1