seqで遊んでみた

###seqとは
https://en.wikipedia.org/wiki/Seq_(Unix)
連続番号や一定間隔に数字の列を出力する時に使うコマンド
seqはsequence(シーケンス)から

###遊んでみる
#####1から10までの連番数列を出力してみる(デフォルトで１が省略しても良い)
>seq 1 10
(seq 10)

```
~/Documents/seq » seq 1 10                                                                                                                                                           
1
2
3
4
5
6
7
8
9
10
```
#####0から100までの間隔が10の数列を出力してみる
間隔の値はスタート値とストップ値の間に入れる形

>seq スタート値 間隔 ストップ値

```
~/Documents/seq » seq 0 10 100                                                                                                                                                    
0
10
20
30
40
50
60
70
80
90
100
```


#####-fオプションで表示フォーマットを揃ってみる
-f '%03g'をつけることで、すべて３桁のフォーマットで表示される
>seq -f '%03g' 0 10 100 

```
~/Documents/seq » seq -f '%03g' 0 10 100                                                                                                                                           
000
010
020
030
040
050
060
070
080
090
100
```

入力内容が自由にアレンジすることもできる
>seq -f 'file-%03g' 0 10 100 

```
~/Documents/seq » seq -f 'file-%03g' 0 10 100                                                                                                                                      
file-000
file-010
file-020
file-030
file-040
file-050
file-060
file-070
file-080
file-090
file-100
```

###応用編
今回の内容でコマンド１行でファイル名の形式が同じフィアルを1000個作ってみる
>touch $(seq -f 'file-%04g.txt' 1 1000)

```
~/Documents/seq » touch $(seq -f 'file-%04g.txt' 1 1000)                                                                                                                           
~/Documents/seq » ls                                                                                                                                                               
file-0001.txt file-0073.txt file-0145.txt file-0217.txt file-0289.txt file-0361.txt file-0433.txt file-0505.txt file-0577.txt file-0649.txt file-0721.txt file-0793.txt file-0865.txt file-0937.txt
file-0002.txt file-0074.txt file-0146.txt file-0218.txt file-0290.txt file-0362.txt file-0434.txt file-0506.txt file-0578.txt file-0650.txt file-0722.txt file-0794.txt file-0866.txt file-0938.txt
file-0003.txt file-0075.txt file-0147.txt file-0219.txt file-0291.txt file-0363.txt file-0435.txt file-0507.txt file-0579.txt file-0651.txt file-0723.txt file-0795.txt file-0867.txt file-0939.txt
file-0004.txt file-0076.txt file-0148.txt file-0220.txt file-0292.txt file-0364.txt file-0436.txt file-0508.txt file-0580.txt file-0652.txt file-0724.txt file-0796.txt file-0868.txt file-0940.txt
file-0005.txt file-0077.txt file-0149.txt file-0221.txt file-0293.txt file-0365.txt file-0437.txt file-0509.txt file-0581.txt file-0653.txt file-0725.txt file-0797.txt file-0869.txt file-0941.txt
file-0006.txt file-0078.txt file-0150.txt file-0222.txt file-0294.txt file-0366.txt file-0438.txt file-0510.txt file-0582.txt file-0654.txt file-0726.txt file-0798.txt file-0870.txt file-0942.txt
file-0007.txt file-0079.txt file-0151.txt file-0223.txt file-0295.txt file-0367.txt file-0439.txt file-0511.txt file-0583.txt file-0655.txt file-0727.txt file-0799.txt file-0871.txt file-0943.txt
file-0008.txt file-0080.txt file-0152.txt file-0224.txt file-0296.txt file-0368.txt file-0440.txt file-0512.txt file-0584.txt file-0656.txt file-0728.txt file-0800.txt file-0872.txt file-0944.txt
file-0009.txt file-0081.txt file-0153.txt file-0225.txt file-0297.txt file-0369.txt file-0441.txt file-0513.txt file-0585.txt file-0657.txt file-0729.txt file-0801.txt file-0873.txt file-0945.txt
file-0010.txt file-0082.txt file-0154.txt file-0226.txt file-0298.txt file-0370.txt file-0442.txt file-0514.txt file-0586.txt file-0658.txt file-0730.txt file-0802.txt file-0874.txt file-0946.txt
file-0011.txt file-0083.txt file-0155.txt file-0227.txt file-0299.txt file-0371.txt file-0443.txt file-0515.txt file-0587.txt file-0659.txt file-0731.txt file-0803.txt file-0875.txt file-0947.txt
file-0012.txt file-0084.txt file-0156.txt file-0228.txt file-0300.txt file-0372.txt file-0444.txt file-0516.txt file-0588.txt file-0660.txt file-0732.txt file-0804.txt file-0876.txt file-0948.txt
file-0013.txt file-0085.txt file-0157.txt file-0229.txt file-0301.txt file-0373.txt file-0445.txt file-0517.txt file-0589.txt file-0661.txt file-0733.txt file-0805.txt file-0877.txt file-0949.txt
file-0014.txt file-0086.txt file-0158.txt file-0230.txt file-0302.txt file-0374.txt file-0446.txt file-0518.txt file-0590.txt file-0662.txt file-0734.txt file-0806.txt file-0878.txt file-0950.txt
file-0015.txt file-0087.txt file-0159.txt file-0231.txt file-0303.txt file-0375.txt file-0447.txt file-0519.txt file-0591.txt file-0663.txt file-0735.txt file-0807.txt file-0879.txt file-0951.txt
file-0016.txt file-0088.txt file-0160.txt file-0232.txt file-0304.txt file-0376.txt file-0448.txt file-0520.txt file-0592.txt file-0664.txt file-0736.txt file-0808.txt file-0880.txt file-0952.txt
file-0017.txt file-0089.txt file-0161.txt file-0233.txt file-0305.txt file-0377.txt file-0449.txt file-0521.txt file-0593.txt file-0665.txt file-0737.txt file-0809.txt file-0881.txt file-0953.txt
file-0018.txt file-0090.txt file-0162.txt file-0234.txt file-0306.txt file-0378.txt file-0450.txt file-0522.txt file-0594.txt file-0666.txt file-0738.txt file-0810.txt file-0882.txt file-0954.txt
file-0019.txt file-0091.txt file-0163.txt file-0235.txt file-0307.txt file-0379.txt file-0451.txt file-0523.txt file-0595.txt file-0667.txt file-0739.txt file-0811.txt file-0883.txt file-0955.txt
file-0020.txt file-0092.txt file-0164.txt file-0236.txt file-0308.txt file-0380.txt file-0452.txt file-0524.txt file-0596.txt file-0668.txt file-0740.txt file-0812.txt file-0884.txt file-0956.txt
file-0021.txt file-0093.txt file-0165.txt file-0237.txt file-0309.txt file-0381.txt file-0453.txt file-0525.txt file-0597.txt file-0669.txt file-0741.txt file-0813.txt file-0885.txt file-0957.txt
file-0022.txt file-0094.txt file-0166.txt file-0238.txt file-0310.txt file-0382.txt file-0454.txt file-0526.txt file-0598.txt file-0670.txt file-0742.txt file-0814.txt file-0886.txt file-0958.txt
file-0023.txt file-0095.txt file-0167.txt file-0239.txt file-0311.txt file-0383.txt file-0455.txt file-0527.txt file-0599.txt file-0671.txt file-0743.txt file-0815.txt file-0887.txt file-0959.txt
file-0024.txt file-0096.txt file-0168.txt file-0240.txt file-0312.txt file-0384.txt file-0456.txt file-0528.txt file-0600.txt file-0672.txt file-0744.txt file-0816.txt file-0888.txt file-0960.txt
file-0025.txt file-0097.txt file-0169.txt file-0241.txt file-0313.txt file-0385.txt file-0457.txt file-0529.txt file-0601.txt file-0673.txt file-0745.txt file-0817.txt file-0889.txt file-0961.txt
file-0026.txt file-0098.txt file-0170.txt file-0242.txt file-0314.txt file-0386.txt file-0458.txt file-0530.txt file-0602.txt file-0674.txt file-0746.txt file-0818.txt file-0890.txt file-0962.txt
file-0027.txt file-0099.txt file-0171.txt file-0243.txt file-0315.txt file-0387.txt file-0459.txt file-0531.txt file-0603.txt file-0675.txt file-0747.txt file-0819.txt file-0891.txt file-0963.txt
file-0028.txt file-0100.txt file-0172.txt file-0244.txt file-0316.txt file-0388.txt file-0460.txt file-0532.txt file-0604.txt file-0676.txt file-0748.txt file-0820.txt file-0892.txt file-0964.txt
file-0029.txt file-0101.txt file-0173.txt file-0245.txt file-0317.txt file-0389.txt file-0461.txt file-0533.txt file-0605.txt file-0677.txt file-0749.txt file-0821.txt file-0893.txt file-0965.txt
file-0030.txt file-0102.txt file-0174.txt file-0246.txt file-0318.txt file-0390.txt file-0462.txt file-0534.txt file-0606.txt file-0678.txt file-0750.txt file-0822.txt file-0894.txt file-0966.txt
file-0031.txt file-0103.txt file-0175.txt file-0247.txt file-0319.txt file-0391.txt file-0463.txt file-0535.txt file-0607.txt file-0679.txt file-0751.txt file-0823.txt file-0895.txt file-0967.txt
file-0032.txt file-0104.txt file-0176.txt file-0248.txt file-0320.txt file-0392.txt file-0464.txt file-0536.txt file-0608.txt file-0680.txt file-0752.txt file-0824.txt file-0896.txt file-0968.txt
file-0033.txt file-0105.txt file-0177.txt file-0249.txt file-0321.txt file-0393.txt file-0465.txt file-0537.txt file-0609.txt file-0681.txt file-0753.txt file-0825.txt file-0897.txt file-0969.txt
file-0034.txt file-0106.txt file-0178.txt file-0250.txt file-0322.txt file-0394.txt file-0466.txt file-0538.txt file-0610.txt file-0682.txt file-0754.txt file-0826.txt file-0898.txt file-0970.txt
file-0035.txt file-0107.txt file-0179.txt file-0251.txt file-0323.txt file-0395.txt file-0467.txt file-0539.txt file-0611.txt file-0683.txt file-0755.txt file-0827.txt file-0899.txt file-0971.txt
file-0036.txt file-0108.txt file-0180.txt file-0252.txt file-0324.txt file-0396.txt file-0468.txt file-0540.txt file-0612.txt file-0684.txt file-0756.txt file-0828.txt file-0900.txt file-0972.txt
file-0037.txt file-0109.txt file-0181.txt file-0253.txt file-0325.txt file-0397.txt file-0469.txt file-0541.txt file-0613.txt file-0685.txt file-0757.txt file-0829.txt file-0901.txt file-0973.txt
file-0038.txt file-0110.txt file-0182.txt file-0254.txt file-0326.txt file-0398.txt file-0470.txt file-0542.txt file-0614.txt file-0686.txt file-0758.txt file-0830.txt file-0902.txt file-0974.txt
file-0039.txt file-0111.txt file-0183.txt file-0255.txt file-0327.txt file-0399.txt file-0471.txt file-0543.txt file-0615.txt file-0687.txt file-0759.txt file-0831.txt file-0903.txt file-0975.txt
file-0040.txt file-0112.txt file-0184.txt file-0256.txt file-0328.txt file-0400.txt file-0472.txt file-0544.txt file-0616.txt file-0688.txt file-0760.txt file-0832.txt file-0904.txt file-0976.txt
file-0041.txt file-0113.txt file-0185.txt file-0257.txt file-0329.txt file-0401.txt file-0473.txt file-0545.txt file-0617.txt file-0689.txt file-0761.txt file-0833.txt file-0905.txt file-0977.txt
file-0042.txt file-0114.txt file-0186.txt file-0258.txt file-0330.txt file-0402.txt file-0474.txt file-0546.txt file-0618.txt file-0690.txt file-0762.txt file-0834.txt file-0906.txt file-0978.txt
file-0043.txt file-0115.txt file-0187.txt file-0259.txt file-0331.txt file-0403.txt file-0475.txt file-0547.txt file-0619.txt file-0691.txt file-0763.txt file-0835.txt file-0907.txt file-0979.txt
file-0044.txt file-0116.txt file-0188.txt file-0260.txt file-0332.txt file-0404.txt file-0476.txt file-0548.txt file-0620.txt file-0692.txt file-0764.txt file-0836.txt file-0908.txt file-0980.txt
file-0045.txt file-0117.txt file-0189.txt file-0261.txt file-0333.txt file-0405.txt file-0477.txt file-0549.txt file-0621.txt file-0693.txt file-0765.txt file-0837.txt file-0909.txt file-0981.txt
file-0046.txt file-0118.txt file-0190.txt file-0262.txt file-0334.txt file-0406.txt file-0478.txt file-0550.txt file-0622.txt file-0694.txt file-0766.txt file-0838.txt file-0910.txt file-0982.txt
file-0047.txt file-0119.txt file-0191.txt file-0263.txt file-0335.txt file-0407.txt file-0479.txt file-0551.txt file-0623.txt file-0695.txt file-0767.txt file-0839.txt file-0911.txt file-0983.txt
file-0048.txt file-0120.txt file-0192.txt file-0264.txt file-0336.txt file-0408.txt file-0480.txt file-0552.txt file-0624.txt file-0696.txt file-0768.txt file-0840.txt file-0912.txt file-0984.txt
file-0049.txt file-0121.txt file-0193.txt file-0265.txt file-0337.txt file-0409.txt file-0481.txt file-0553.txt file-0625.txt file-0697.txt file-0769.txt file-0841.txt file-0913.txt file-0985.txt
file-0050.txt file-0122.txt file-0194.txt file-0266.txt file-0338.txt file-0410.txt file-0482.txt file-0554.txt file-0626.txt file-0698.txt file-0770.txt file-0842.txt file-0914.txt file-0986.txt
file-0051.txt file-0123.txt file-0195.txt file-0267.txt file-0339.txt file-0411.txt file-0483.txt file-0555.txt file-0627.txt file-0699.txt file-0771.txt file-0843.txt file-0915.txt file-0987.txt
file-0052.txt file-0124.txt file-0196.txt file-0268.txt file-0340.txt file-0412.txt file-0484.txt file-0556.txt file-0628.txt file-0700.txt file-0772.txt file-0844.txt file-0916.txt file-0988.txt
file-0053.txt file-0125.txt file-0197.txt file-0269.txt file-0341.txt file-0413.txt file-0485.txt file-0557.txt file-0629.txt file-0701.txt file-0773.txt file-0845.txt file-0917.txt file-0989.txt
file-0054.txt file-0126.txt file-0198.txt file-0270.txt file-0342.txt file-0414.txt file-0486.txt file-0558.txt file-0630.txt file-0702.txt file-0774.txt file-0846.txt file-0918.txt file-0990.txt
file-0055.txt file-0127.txt file-0199.txt file-0271.txt file-0343.txt file-0415.txt file-0487.txt file-0559.txt file-0631.txt file-0703.txt file-0775.txt file-0847.txt file-0919.txt file-0991.txt
file-0056.txt file-0128.txt file-0200.txt file-0272.txt file-0344.txt file-0416.txt file-0488.txt file-0560.txt file-0632.txt file-0704.txt file-0776.txt file-0848.txt file-0920.txt file-0992.txt
file-0057.txt file-0129.txt file-0201.txt file-0273.txt file-0345.txt file-0417.txt file-0489.txt file-0561.txt file-0633.txt file-0705.txt file-0777.txt file-0849.txt file-0921.txt file-0993.txt
file-0058.txt file-0130.txt file-0202.txt file-0274.txt file-0346.txt file-0418.txt file-0490.txt file-0562.txt file-0634.txt file-0706.txt file-0778.txt file-0850.txt file-0922.txt file-0994.txt
file-0059.txt file-0131.txt file-0203.txt file-0275.txt file-0347.txt file-0419.txt file-0491.txt file-0563.txt file-0635.txt file-0707.txt file-0779.txt file-0851.txt file-0923.txt file-0995.txt
file-0060.txt file-0132.txt file-0204.txt file-0276.txt file-0348.txt file-0420.txt file-0492.txt file-0564.txt file-0636.txt file-0708.txt file-0780.txt file-0852.txt file-0924.txt file-0996.txt
file-0061.txt file-0133.txt file-0205.txt file-0277.txt file-0349.txt file-0421.txt file-0493.txt file-0565.txt file-0637.txt file-0709.txt file-0781.txt file-0853.txt file-0925.txt file-0997.txt
file-0062.txt file-0134.txt file-0206.txt file-0278.txt file-0350.txt file-0422.txt file-0494.txt file-0566.txt file-0638.txt file-0710.txt file-0782.txt file-0854.txt file-0926.txt file-0998.txt
file-0063.txt file-0135.txt file-0207.txt file-0279.txt file-0351.txt file-0423.txt file-0495.txt file-0567.txt file-0639.txt file-0711.txt file-0783.txt file-0855.txt file-0927.txt file-0999.txt
file-0064.txt file-0136.txt file-0208.txt file-0280.txt file-0352.txt file-0424.txt file-0496.txt file-0568.txt file-0640.txt file-0712.txt file-0784.txt file-0856.txt file-0928.txt file-1000.txt
file-0065.txt file-0137.txt file-0209.txt file-0281.txt file-0353.txt file-0425.txt file-0497.txt file-0569.txt file-0641.txt file-0713.txt file-0785.txt file-0857.txt file-0929.txt
file-0066.txt file-0138.txt file-0210.txt file-0282.txt file-0354.txt file-0426.txt file-0498.txt file-0570.txt file-0642.txt file-0714.txt file-0786.txt file-0858.txt file-0930.txt
file-0067.txt file-0139.txt file-0211.txt file-0283.txt file-0355.txt file-0427.txt file-0499.txt file-0571.txt file-0643.txt file-0715.txt file-0787.txt file-0859.txt file-0931.txt
file-0068.txt file-0140.txt file-0212.txt file-0284.txt file-0356.txt file-0428.txt file-0500.txt file-0572.txt file-0644.txt file-0716.txt file-0788.txt file-0860.txt file-0932.txt
file-0069.txt file-0141.txt file-0213.txt file-0285.txt file-0357.txt file-0429.txt file-0501.txt file-0573.txt file-0645.txt file-0717.txt file-0789.txt file-0861.txt file-0933.txt
file-0070.txt file-0142.txt file-0214.txt file-0286.txt file-0358.txt file-0430.txt file-0502.txt file-0574.txt file-0646.txt file-0718.txt file-0790.txt file-0862.txt file-0934.txt
file-0071.txt file-0143.txt file-0215.txt file-0287.txt file-0359.txt file-0431.txt file-0503.txt file-0575.txt file-0647.txt file-0719.txt file-0791.txt file-0863.txt file-0935.txt
file-0072.txt file-0144.txt file-0216.txt file-0288.txt file-0360.txt file-0432.txt file-0504.txt file-0576.txt file-0648.txt file-0720.txt file-0792.txt file-0864.txt file-0936.txt
```

一瞬にして作成できた

以上