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

          主站蜘蛛池模板: 治县。| 丹江口市| 五家渠市| 土默特右旗| 梧州市| 桓台县| 会泽县| 黄大仙区| 静乐县| 沂南县| 沂源县| 分宜县| 龙海市| 南平市| 巴彦淖尔市| 铜陵市| 土默特左旗| 饶河县| 阿拉善左旗| 集贤县| 桐城市| 富川| 石渠县| 南靖县| 琼中| 郑州市| 兴隆县| 潮安县| 晋城| 绵竹市| 黎城县| 吉安市| 贡觉县| 嘉定区| 龙州县| 桂林市| 澎湖县| 嘉义县| 盐津县| 湾仔区| 西藏|