Chan Chen Coding...

          Split Large File in Linux

          Have you ever want to split a large file into several small files? I’ve face this problem few days ago. I need to split a large file (4.4GB log file) into several smaller file where i can read it using normal text editor (vim etc.).

          To split large file into several smaller files, you can use split command in Linux. Just follow the steps below and you will be able to split large file into smaller files. 

          $split -b 100m /path/to/large/file /path/to/output/file/prefix

          • Done. You just split your large file into several smaller files

          * You can change the output file size by changing the –bytes=1m to your preference. You can use b, k, or m. b represent bytes, k represent kilobytes, m represent megabytes.

          To restore the original file, you can use cat command.
          To join all the smaller file to restore the original file type:-

          $cat prefix* > new/file/name



          -----------------------------------------------------
          Silence, the way to avoid many problems;
          Smile, the way to solve many problems;

          posted on 2012-10-22 14:03 Chan Chen 閱讀(528) 評論(0)  編輯  收藏 所屬分類: Linux

          主站蜘蛛池模板: 山丹县| 罗江县| 潼关县| 八宿县| 三台县| 承德市| 翁源县| 江华| 蒙城县| 夏津县| 个旧市| 萨迦县| 墨竹工卡县| 潜山县| 炎陵县| 夏津县| 南投县| 台北县| 祁连县| 雷州市| 故城县| 巴南区| 建平县| 汉中市| 宜丰县| 墨脱县| 兰西县| 鹤庆县| 阳高县| 常德市| 油尖旺区| 遂溪县| 冕宁县| 边坝县| 保定市| 诸城市| 遂川县| 玉林市| 湘乡市| 紫金县| 娄底市|