How to cut videos in Linux

Source: Internet
Author: User

The powerful and practical functions of the Linux operating system have led many people to apply the Linux operating system. There will be many problems during the learning process. For example, if you want to send a large video to a friend with hundreds of MB, after trying multiple transmission methods, the last thought was to cut the video into a piece and "mail" it to him to assemble it.

 
 
  1. [root@pps public_rw]# ls -lh RevolutionOS.rmvb  
  2. -rwx------ 1 hoho hoho 276M 2005-09-09 RevolutionOS.rmvb 

Split the 276M file into 20 m small files. The operations are as follows:

Usage: split [Option] [input [prefix]

 
 
  1. [Root @ pps public_rw] # split-B 20 m RevolutionOS. rmvb RevOS_part _
  2. [Root @ pps public_rw] # ls-lh
  3. Total 552 M
  4. -Rwx ------ 1 hoho 276 M 2005-09-09 RevolutionOS. rmvb
  5. -Rw-r -- 1 root 20 M 03-19 17:59 RevOS_part_aa
  6. -Rw-r -- 1 root 20 M 03-19 17:59 RevOS_part_ AB
  7. ...
  8. -Rw-r -- 1 root 20 M 03-19 18:00 RevOS_part_am
  9. -Rw-r -- 1 root 16 M 03-19 18:00 RevOS_part_an

"-B 20 M" specifies that the size of the split file is 20 M. The "RevOS_part _" after the file is the prefix of the split file, and the last is the 16 M "remaining" file.

Assembly file:

 
 
  1. [root@pps public_rw] cat RevOS_part_* > RevolutionOS_RSB.rmvb  

We are not afraid of Assembly Order errors here, because the separation is performed in alphabetical order, and cat is also handled in alphabetical order. If you are not at ease, compare the assembled files.

 
 
  1. [root@pps public_rw]# md5sum RevolutionOS.rmvb  
  2. ac7cce07f621b1ed6f692e6df0ac8c16  RevolutionOS.rmvb  
  3. [root@pps public_rw]# md5sum RevolutionOS_RSB.rmvb  
  4. ac7cce07f621b1ed6f692e6df0ac8c16  RevolutionOS_RSB.rmvb 

If you want to split a text file, such as thousands of lines, and the number of characters in each line is not equal, you want to split it by the number of lines. For example, one file is generated for every 100 lines, only the-l parameter is required, as shown below:

[Root @ pps public_rw] # split-l 100 test.txt

In fact, if no parameter is added, the data is split by 1000 rows by default. In this way, the steps for splitting large files by using the split command in Linux are completed.

  1. Easily connect to the campus network using Linux
  2. Fully Understand Linux Process Technology
  3. Introduction to the password command in Linux
  4. Learn about Linux regulatory commands
  5. How to view the ps-aux command of all processes in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.