我想复制和重命名一个目录中的多个 c 源文件。
我可以这样复制:
$ cp *.c $OTHERDIR
Run Code Online (Sandbox Code Playgroud)
但我想给所有文件名一个前缀:
file.c --> old#file.c
Run Code Online (Sandbox Code Playgroud)
我怎样才能在 1 步中做到这一点?
我有一个错误 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)