LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-04-2015, 06:20 PM   #1
ArtiSeven
LQ Newbie
 
Registered: Apr 2015
Location: Kuwait City
Distribution: Debian
Posts: 9

Rep: Reputation: 10
Exclamation [Kali Linux] How do i split a 15.7GB text file into 3 parts also...


On kali, how do i split a 15.7gb text file into 3 parts ? Also when i split the text file i don't want words to be incomplete from the split. Please help on how to exactly do it. Writing the exact commands to my specific situation would help me out a lot. Thanks in advance.
 
Old 04-04-2015, 08:46 PM   #2
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,571

Rep: Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489
Welcome to LQ!
It is usual to expect that you demonstrate some attempt to solve your problem when posting at LQ, rather than just asking to be fed a solution.

However,
Get a count of the number of lines in the file with
Code:
wc -l <filename>
Create files with
Code:
sed -n X,Yp <filename> > <outputfile>
where X and Y are the line numbers to start and stop splitting.
 
1 members found this post helpful.
Old 04-04-2015, 09:34 PM   #3
ArtiSeven
LQ Newbie
 
Registered: Apr 2015
Location: Kuwait City
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by allend View Post
Welcome to LQ!
It is usual to expect that you demonstrate some attempt to solve your problem when posting at LQ, rather than just asking to be fed a solution.

However,
Get a count of the number of lines in the file with
Code:
wc -l <filename>
Create files with
Code:
sed -n X,Yp <filename> > <outputfile>
where X and Y are the line numbers to start and stop splitting.
First of all, thank you for welcoming me.
Secondly, i didn't understand. I've read a handful of posts regarding my situation and none of them helped me quite understand this complex issue, this is why i wanted to be "fed" the answer. It's been 2 days for me trying to figure this out but unfortunately, none of the posts including yours were comprehensive enough for me. I usually learn by doing rather than being given hints and/or examples. Thanks for trying though.

Last edited by ArtiSeven; 04-04-2015 at 09:50 PM.
 
Old 04-04-2015, 11:07 PM   #4
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
wc -l shows number of lines in a file.

And sed is a stream editor. Read man or info pages about it.

The -n suppresses normal output.

X specifies starting line. Y specifies endling line, p is command and prints addresses specified.
 
1 members found this post helpful.
Old 04-04-2015, 11:20 PM   #5
allend
Senior Member
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,571

Rep: Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489Reputation: 1489
The commands in post #2 are meant to be typed in a terminal window opened in the directory containing the file that you wish to split. You will need to provide the filename of the file you wish to split, in place of <filename>. You will also need to provide the filename(s) of the file(s) that you wish to contain the output, in place of <outputfile>.

An example session where the input filename is ifile.txt
Code:
bash-4.3$ wc -l ifile.txt
592 ifile.txt
bash-4.3$ sed -n 1,200p ifile.txt > ofile1.txt
bash-4.3$ sed -n 201,400p ifile.txt > ofile2.txt
bash-4.3$ sed -n 401,592p ifile.txt > ofile3.txt
 
1 members found this post helpful.
Old 04-04-2015, 11:29 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 4,405
Blog Entries: 1

Rep: Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369Reputation: 2369
You might also see...

Code:
man split
man join
I do not know if they are included in Kali, but if so the man pages should be there too.

I am also not sure if they can guarantee that words will not be split, but it appears they work by lines which might make that safe.
 
1 members found this post helpful.
Old 04-04-2015, 11:49 PM   #7
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,107

Rep: Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478Reputation: 2478
you are aware that Kali is a special purpose operating system
( with really one function )

a os that is meant to be used BY network security EXPERTS
experts that have at least a masters degree ( or equivalent in real world experience)


the normal Kali user ( the users that are the target market ) can from memory wright the documentation all on there own


kali was NEVER designed with the NEW TO LINUX user in mind
( nor with the NEW TO MICROSOFT user )

spliting a text file in "cmd.exe" is about the same as using the linux Bash terminal
 
Old 04-05-2015, 01:18 AM   #8
ArtiSeven
LQ Newbie
 
Registered: Apr 2015
Location: Kuwait City
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by John VV View Post
you are aware that Kali is a special purpose operating system
( with really one function )

a os that is meant to be used BY network security EXPERTS
experts that have at least a masters degree ( or equivalent in real world experience)


the normal Kali user ( the users that are the target market ) can from memory wright the documentation all on there own


kali was NEVER designed with the NEW TO LINUX user in mind
( nor with the NEW TO MICROSOFT user )

spliting a text file in "cmd.exe" is about the same as using the linux Bash terminal
And you ARE aware that you are being rude and presumptuous, right ? Listen... we're all here to learn in the end. I don't know split commands because i've never gotten the chance to use them before, so why is it so wrong for me to seek help ?

I've been pentesting for 2 and a half years and have a great understanding of Networking and infoSec. My shell knowledge is decent but could use a little work, hence this thread. But you actually SORELY made me laugh when you said that Kali is only for those who have at least a masters degree in Network Security.. (WAKE UP, most hackers are college dropouts LOL) I don't mean to burst your bubble, but you're an illiterate moron. I'm honestly shocked and appalled at how ignorant and biased you are. I've been using Kali for a couple of months now and I can honestly say that it's the best and most intuitive Linux distro I have ever used.

Unlike you, these other people are actually kind enough to try and help me and I can't even begin to describe how happy I am to see REAL contributions. So don't you dare insult me and try (and fail) to humiliate me publicly, JUST BECAUSE I asked a simple, straight-forward question to LEARN. But no... you decided that you wanna be an ungentlemanly twerp, and enforce negativity upon this thread.

I would also like to inform you that I don't have the time, nor patience to deal with disrespectful individuals such as yourself. So if you were offended, deal with it, as I dealt with your sarcastic and fruitless response.

Peace.

Last edited by ArtiSeven; 04-05-2015 at 08:38 AM.
 
Old 04-05-2015, 08:39 PM   #9
ehdunf67
LQ Newbie
 
Registered: Apr 2015
Location: Canada
Distribution: Kali Linux, Windows, Ubuntu
Posts: 18

Rep: Reputation: Disabled
Quote:
Originally Posted by ArtiSeven View Post
On kali, how do i split a 15.7gb text file into 3 parts ? Also when i split the text file i don't want words to be incomplete from the split. Please help on how to exactly do it. Writing the exact commands to my specific situation would help me out a lot. Thanks in advance.
Try downloading this: http://www.devtxt.com/blog/large-fil...le-app-utility

I just looked up a program that splits large texts files into seperate files. I don't know if this is exactly what you wanted, but you can try it.
 
1 members found this post helpful.
Old 04-07-2015, 12:28 AM   #10
ArtiSeven
LQ Newbie
 
Registered: Apr 2015
Location: Kuwait City
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by ehdunf67 View Post
Try downloading this: http://www.devtxt.com/blog/large-fil...le-app-utility

I just looked up a program that splits large texts files into seperate files. I don't know if this is exactly what you wanted, but you can try it.
Thanks, i'll give it a try and let you know
 
Old 04-07-2015, 01:27 AM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Wow,I understand how you feel, but, what John VV stated is true, also in no way rude.
Also allend gave you 2 commands in post #2 & broke it down in post #5.
As far as I can see allends first post, post #2, should have been fine & easier to understand than a man page.
 
Old 04-07-2015, 11:27 AM   #12
ArtiSeven
LQ Newbie
 
Registered: Apr 2015
Location: Kuwait City
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by EDDY1 View Post
Wow,I understand how you feel, but, what John VV stated is true, also in no way rude.
Also allend gave you 2 commands in post #2 & broke it down in post #5.
As far as I can see allends first post, post #2, should have been fine & easier to understand than a man page.
First and foremost, the help that allend offered me was most appreciated and I am very thankful for his contributions. Don't muddle my words.

Secondly, what johnvv said was PARTLY true (I do admit). However, the rest was complete and utter ridicule and filth. The fact that he thinks that Kali should ONLY be used by individuals who have at least a masters degree in netSec is just half-witted. The fact that he ASSUMES i'm just a demented kid behind a silly little keyboard is just ill-mannered and hurtful regardless of my experience. The fact that he went out of his way to mock me for trying to LEARN is also idiotic and unreasonable. So if you actually agree with him then I have nothing to say to you because the derision was pretty crystal clear and if you don't see it then you really need to learn how civilized people communicate to fully apprehend my predicament.

Lastly... this is not a chatroom, so unless you have any help to offer, please refrain from commenting. Because like I told johnvv before, I don't have the time nor patience to deal with misleading conflicts.

Thanks.
 
Old 04-08-2015, 01:11 AM   #13
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I must apologize for my post as I don't want to be taken as ill-mannered or hurtful, but, I do think that you should really evaluate the replies that you have gotten, even if at the present time you think that they are negative.

All I can say is the basic command line normally would come before pentesting.
 
Old 04-08-2015, 03:00 AM   #14
ArtiSeven
LQ Newbie
 
Registered: Apr 2015
Location: Kuwait City
Distribution: Debian
Posts: 9

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by EDDY1 View Post
I must apologize for my post as I don't want to be taken as ill-mannered or hurtful, but, I do think that you should really evaluate the replies that you have gotten, even if at the present time you think that they are negative.

All I can say is the basic command line normally would come before pentesting.
Thank you and like I said, I have reevaluated the replies I got and I am thankful for any support even if it didn't help me.
I do agree that learning the basic command line before moving on to pentesting is generally the way to go and this is exactly what I did. But as I mentioned before... I never really got the chance to use split commands before and so it became a weakness on my behalf. All I really wanted was help on that particular issue, nothing more, nothing less.

I usually hate getting on forums for support. But sometimes, it feels like i'm cornered and I have no other way to go. Why do I hate going on forums for support ? Well that's pretty self-explanatory. johnvv's reply was quite evident. Another reason would be that people like johnvv... usually trying to start a debate or mock you and make you feel deficient for trying to learn something.

I hope that cleared things up.

Thanks.

Last edited by ArtiSeven; 04-08-2015 at 03:12 AM.
 
Old 04-08-2015, 03:09 AM   #15
AnanthaP
Member
 
Registered: Jul 2004
Location: Chennai, India
Distribution: UBUNTU 5.10 since Jul-18,2006 on Intel 820 DC
Posts: 841

Rep: Reputation: 201Reputation: 201Reputation: 201
Quote:
All I can say is the basic command line normally would come before pentesting.
+1 to that.

Quote:
complete and utter ridicule and filth.
Huh?

OK
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
split DVD (7gb ) into 4.7 DBabo Linux - Software 6 12-11-2015 02:46 PM
[SOLVED] split huge file into small parts and compress them. xeon123 Linux - General 5 06-02-2011 04:17 AM
bash: how to split a text file in two unequal parts Humbro Programming 7 11-23-2007 07:15 AM
Copying parts of a text file austen77 Linux - Newbie 3 09-01-2005 09:56 PM
How do I split a 6.7GB movie dvd into two RottenMutt Linux - Software 4 04-19-2004 01:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration