0
votes
1answer
14 views

using ubuntu command line to replace text in huge file

hi i have a huge xml file that i must work with. right now the file is only 1 line that contains about 2 million characters which represent 30,000 records. there are no carriage returns or linefeeds ...
0
votes
1answer
23 views

Check user input is alpha numeric

Hi Im not any sort of programmer but found myself creating an install script which installs mySQL which works fine. I would like to improve the script by asking the user to enter text that will be ...
0
votes
4answers
829 views

How to add words to a text file using just open terminal command (no editors) and then save the text file

I'm new to Linux. I need to edit .conf file from open terminal only and not using any text editors. That is, can I add words and sentences to a config file from open terminal? Example: command ...
0
votes
0answers
34 views

I get a blank screen when I CTRL-ALT-F2 in Ubuntu 12.04 [duplicate]

I have just noticed that I can no longer log in another text shell in my ubuntu 12.04. Appart from that, sometimes my pc hangs as it boots, i.e. it does not bring the GUI, until I try several times ...
0
votes
1answer
392 views

print contents of a directory structure (filesystem) to CSV on the command line

How can I catalog the contents of a filesystem to a CSV file? This is particularly useful for removable media. I've found a couple links that point in this direction: AskUbuntu.com: listing files ...
5
votes
7answers
4k views

How do I combine all lines in a text file into a single line?

I want to get all lines in a text into one line. I'm a beginner at coding trying to learn by doing. I've spent four hours trying to solve this problem. I know there's a simple solution to this ...
2
votes
3answers
961 views

How do I delete a random line in a text file from a given range?

I have a text file and I want to delete random lines from a range. Here is an example: Line 1: abcd Line 2: efgh Line 3: ijkl Line 4: mnop Line 5: qrst Line 6: uvwxyz Out of these six, I want ...
15
votes
3answers
23k views

Why does “ps aux | grep x” give better results than “pgrep x”?

I've just tried the following command on my Ubuntu, it doesn't show a thing: pgrep php5 shouldn't it return the process id of php5(which the following command just does)?: ps aux | grep php5 So, ...
3
votes
1answer
3k views

Why can't I copy text from the Ubuntu Terminal?

This is really weird. I can't copy anything from the terminal. The Ctrl+Shift+C command and Edit->Copy does nothing, no matter how much or little text I have selected. What ever was on my clipboard ...
4
votes
2answers
560 views

Is there a simple way to visualize a spreadsheet in terminal or as clear text?

I want to be able to easily show a simple text-only representation of a spreadsheet (Calc or Excel) via the command line (so I can pipe that output to usual Linux text manipulation tools). Is there a ...
3
votes
2answers
2k views

align columns right

For the command shell, is there a common program like column that has an option to align specific or all columns to the right, if not also detect numeric fields and do so automatically for those? ...
2
votes
2answers
1k views

How to install a list of programs in a .txt file automatically through a terminal

I'm sure I've seen instructions on how do do this unfortunately it was a few months ago and have forgotten them. Thanks in advance to anyone who answers.
3
votes
3answers
2k views

Text conversion, binary digits -> hex (or decimal)

I have a huge text file with digits representing an 8 bit value in binary. I want to convert these to hexadecimal (or decimal, doesn't really matter). That is, I have a text file containing e.g. 0 0 ...
9
votes
3answers
4k views

How can I encode and decode percent-encoded strings on the command line?

How can I encode and decode percent-encoded (URL encoded) strings on the command line? I'm looking for a solution that can do this: $ percent-encode "ændrük" %C3%A6ndr%C3%BCk $ percent-decode ...
0
votes
1answer
273 views

Terminal: Overlapping text

i have written a tcp/ip chat program but i have a problem. On client program while user writing message, a background thread receives messages from an other client and writes the message to terminal. ...
5
votes
4answers
5k views

How to append multiple lines of text to a file?

I want to append this text: <Directory "/var/www/*"> Order allow,deny Allow from all AllowOverride All </Directory> to the file /etc/apache2/apache2.conf I have access via ...
4
votes
5answers
1k views

Is there a command-line utility app which can find a specific block of lines in a text file, and replace it?

UPDATE (see end of question) The text "search and replace" utility programs I've seen, seem to only search on a line-by-line basis... Is there a command-line tool which can locate one block of ...