2日目からかなり難しくなってきた。

ディレクトリ作成
image.png
1,1-2,1-3,1-4,1-5に2018cal.txtをコピーそれを一行でおこなう
mkdir -p 20180404/1/2/3/4/5
cd 20180404
mkdir 1-2
mkdir 1-3
mkdir 1-4
mkdir 1-5
cal > 2018cal.txt
cp 2018cal.txt 1-2; cp 2018cal.txt 1-3; cp 2018cal.txt 1-4 ; cp 2018cal.txt 1-5; cp 2018cal.txt
ls -l

[root@ik1-331-25935 home]# mkdir -p 20180404/1/2/3/4/5
[root@ik1-331-25935 home]# cd 20180404
[root@ik1-331-25935 20180404]# mkdir 1-2
[root@ik1-331-25935 20180404]# mkdir 1-3
[root@ik1-331-25935 20180404]# mkdir 1-4
[root@ik1-331-25935 20180404]# mkdir 1-5
[root@ik1-331-25935 20180404]# cal > 2018cal.txt
[root@ik1-331-25935 20180404]# cp 2018cal.txt 1-2; cp 2018cal.txt 1-3; cp 2018cal.txt 1-4 ; cp 2018cal.txt 1-5; cp 2018cal.txt 
[root@ik1-331-25935 20180404]# ls -l
total 4
drwxr-xr-x 3 root root  32 Apr  4 17:45 1
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-2
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-3
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-4
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-5
-rw-r--r-- 1 root root 133 Apr  4 17:43 2018cal.txt

mv 1/2018cal.txt 1/2018.txt.1
%20180404ディレクトリから1ディレクトリにあるファイルを2018.txt.1に変更
cd 1
ls -l

[root@ik1-331-25935 20180404]# mv 1/2018cal.txt 1/2018.txt.1
[root@ik1-331-25935 20180404]# cd 1
[root@ik1-331-25935 1]# ls -l
total 4
drwxr-xr-x 3 root root  14 Apr  4 17:42 2
-rw-r--r-- 1 root root 133 Apr  4 17:45 2018.txt.1

cp 2018.txt.1 ../20180404.txt
%2018.txt.1を20180404ディレクトリにファイル名を20180404.txtに変えてコピーする

[root@ik1-331-25935 1]# cp 2018.txt.1 ../20180404.txt
[root@ik1-331-25935 1]# cd ..
[root@ik1-331-25935 20180404]# ls -l
total 8
drwxr-xr-x 3 root root  31 Apr  4 18:03 1
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-2
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-3
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-4
drwxr-xr-x 2 root root  24 Apr  4 17:45 1-5
-rw-r--r-- 1 root root 133 Apr  4 18:14 20180404.txt
-rw-r--r-- 1 root root 133 Apr  4 17:43 2018cal.txt
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.