将文件组移动到子目录中

将文件组移动到子目录中

我想将一些 ssh 密钥移动到备份文件中。具体来说,我想移动id_rsa*key_backups/.ssh 的子目录mv id_rsa* key_backup/中。

usage: mv [-f | -i | -n] [-v] source target
   mv [-f | -i | -n] [-v] source ... directory

但我觉得我所做的属于第二种……

编辑

total 64
drwx------  11 chrismaddox  staff   374 Apr 30 14:12 .
drwxr-xr-x+ 56 chrismaddox  staff  1904 May  5 11:05 ..
-rw-r--r--   1 chrismaddox  staff    61 Apr 10 13:11 config
-rw-------   1 chrismaddox  staff  1766 Mar 15 14:07 github_rsa
-rw-r--r--   1 chrismaddox  staff   393 Mar 15 14:07 github_rsa.pub
-rw-------   1 chrismaddox  staff   668 Mar 16 14:11 id_dsa
-rw-r--r--   1 chrismaddox  staff   623 Mar 16 14:11 id_dsa.pub
-rw-------   1 chrismaddox  staff  1679 Mar 16 14:28 id_rsa
-rw-r--r--   1 chrismaddox  staff  1679 May  5 13:00 id_rsa.pub
drwxr-xr-x   2 chrismaddox  staff    68 Mar  8 16:38 key_backup
-rw-r--r--   1 chrismaddox  staff  3188 Apr 30 15:36 known_hosts

答案1

$ ls
id_rsa  id_rsa.pub  key_backup  known_hosts

$ mv id_rsa* key_backup/

$ ls
key_backup  known_hosts

$ ls key_backup
id_rsa  id_rsa.pub

相关内容