Split large file and combine file in Linux Rumi, August 6, 2019August 6, 2019 $ du -h Linux\ Security.mp4 Sample output: 1.1G Linux Security.mp4 As you see, the video file size is 1.1 GiB, which is very large to upload to my google drive. Even though, Google Drive lets users upload files up to 5TB in size, it is really time consuming process. With my low speed Internet connection, I presume it would take more than 30 minutes to upload. I don’t want to wait that much longer. So, what I am going to do is split this file into multiple smaller size files, for example 100 MB each, to make upload process faster. Now, let us split the above file into multiple smaller files, say for example 100MB each. To do so, run: $ split -b 100M Linux\ Security.mp4 ls. The above command splits the Linux Security.mp4 file into 100MB chunks. This command creates files named ls.aa, ls.ab, ls.ac.. and so on. Let us take a look at the output after splitting the large file. $ ls Sample output: 'Linux Security.mp4' ls.ab ls.ad ls.af ls.ah ls.aj ls.aa ls.ac ls.ae ls.ag ls.ai ls.ak See? Linux Security.mp4 file has been split into multiple files named ls.aa, ls.ab …. ls.ak etc. Each file size is 100MB. Now, It is little bit easy to send them as Email attachment. Combine files in Linux from command line Save all files in a folder. And then, go to that folder and combine them as follows. $ cat ls.?? > Linux_security.mp4 Here, Linux_security.mp4 is output file name. The double question marks(??) match any two-character extension in the file name. To put this simply, the filename part ls.?? matches all filenames such as ls.aa, ls.ab ..etc., and combine all of them into single file. Please be mindful that this command will combine all files that contains two-character extensions. So, be sure before combining files. If there are some other files with two letter extensions, they will also be merged into the output file. Also, don’t forget to mention the correct extension while merging them. In case, you want to send all files via mail to your friend, tell him/her the correct extension of the files you have sent. He/she should use the same file extension in the output file while combining them. If you don’t specify any argument in the split command, the file will split into multiple smaller files with x** as file names. Each file would contain 1000 lines by default. Here, ** is the two character suffix that is added by default with each file name. Let us split the same file using split command without specifying any extra arguments like below. $ split Linux\ Security.mp4 This command splits the Linux security file into multiple smaller files with x** as file names. Run ‘ls’ command to view the files: $ ls Sample output: Linux Security.mp4 xaj xat xbd xbn xbx xch xcr xdb xdl xdv xef xep xez xfj xaa xak xau xbe xbo xby xci xcs xdc xdm xdw xeg xeq xfa xfk xab xal xav xbf xbp xbz xcj xct xdd xdn xdx xeh xer xfb xfl xac xam xaw xbg xbq xca xck xcu xde xdo xdy xei xes xfc xfm xad xan xax xbh xbr xcb xcl xcv xdf xdp xdz xej xet xfd xae xao xay xbi xbs xcc xcm xcw xdg xdq xea xek xeu xfe xaf xap xaz xbj xbt xcd xcn xcx xdh xdr xeb xel xev xff xag xaq xba xbk xbu xce xco xcy xdi xds xec xem xew xfg xah xar xbb xbl xbv xcf xcp xcz xdj xdt xed xen xex xfh xai xas xbc xbm xbw xcg xcq xda xdk xdu xee xeo xey xfi Each file should contain 1000 lines. You can also verify it using wc (word count) command as shown below. $ wc -l * Sample output would be: 142891 Linux Security.mp4 1000 xaa 1000 xab 1000 xac 1000 xad 1000 xae 1000 xaf 1000 xag 1000 xah . . . 1000 xfl 891 xfm 285782 total To combine all these files, run: $ cat x* > ls.mp4 The above command will combine all files into a single file called ls.mp4. For more details, refer man pages. $ man split Related Administrations Configurations (Linux)
Icinga Resources May 31, 2011June 11, 2012 http://www.howtoforge.com/icinga-monitoring-solution-installation-and-configuration-on-centos http://www.kernelhardware.org/nagios-nrpe-to-monitor-remote-linux-server/ http://docs.icinga.org/1.0.1/en/quickstart-icinga.html http://danielaliaman.com/blog///index.php/install_nrpe_on_debian_host?blog=2 http://nagios.sourceforge.net/docs/3_0/monitoring-publicservices.html http://winnersdontlose.com/?p=67 http://kedar.nitty-witty.com/blog/10-steps-mysql-monitoring-nagios-installation-configuration https://sites.google.com/a/blueprint.org/infrastructure/Home/List-of-All-Tasks/Configure-new-Nagios-clients http://docs.icinga.org/1.2/en/ http://docs.icinga.org/1.2/en/monitoring-windows.html http://docs.icinga.org/1.2/en/monitoring-routers.html http://docs.icinga.org/1.2/en/verifyconfig.html http://docs.icinga.org/1.2/Icinga_v12_en.pdf http://efwsupport.com/index.php?topic=451.0 http://www.deobfuscate.net/?p=680 http://www.nagios-wiki.de/nagios/plugins/check_http http://linuxsysadminblog.com/2009/01/monitoring-a-java-application-from-nagios/ http://linuxsysadminblog.com/2009/02/nagios-how-to-check-if-remote-process-is-running/ http://techblog.willshouse.com/2012/03/26/nagios-check_dns-example/ Related Read More
Install Netbox on Docker June 19, 2020June 19, 2020 The first thing to do is the installation of Docker. To do this, open a terminal window and issue the following commands: Install Docker with the command: sudo apt-get install docker.io -y Add your user to the docker group with the command: sudo usermod -aG docker $USER. Log out and… Read More
How to setup vsftpd FTP with SSL on Ubuntu 12.04 December 7, 2015December 7, 2015 This tutorial teaches you, how to setup vsftpd server on Linux based dedicated Web server. The tutorial also teaches you how to add the ftp users and lock the directory to individual users(In this scenario,lock the users into their individual web directory). In Ubuntu 12.04, vsftpd with chrooted users gives the following… Read More