General :: Find The Position Of The First Space In A Line?

Aug 8, 2011

I am trying to edit a large bunch of files. Each file has four columns and I want to get rid of the first one, but in each line the number of the first column changes. the number in the first column ranges from 1 digit to 5. For example

1 aaaaa bbbbbb ccccc
23 aaaaa bbbbbb ccccc
15343 aaaaa bbbbbb ccccc

and the desired format would be

aaaaa bbbbbb ccccc
aaaaa bbbbbb ccccc
aaaaa bbbbbb ccccc

View 2 Replies


ADVERTISEMENT

General :: Get The Cursor Position Line At The Mid Of The Windows In Vim?

Mar 28, 2010

Suppose the cursor position line at bottom or top. What's the vim command to get the cursor position line at the mid of the windows in vim?

View 5 Replies View Related

Programming :: Set Indent In .emacs To Enable New Line Starts From The Same Position Of Previous Line?

Dec 29, 2010

How can I set indent in .emacs to enable my new line starts from the same position of previous line?

like this;

Hello world <enter>
Second Hello world // "S" starts right under first line's "H"

View 4 Replies View Related

Programming :: BASH Sort List By End Of Line To X Position In Each Line?

Aug 18, 2010

I'm trying to make another file annotation script a little speedier than it has been by the up-until-now proven method of checking the last four characters in a filename before the "dot" (eg .jpg, .psd) against a list of known IPTC categories and Exiv2 command files. It occurred to me that if one script generated a list of files in directory foo, and the same or another script sorted that list by that four-letter tag,then that list could be used(instead of a for/do/done loop on the real files in the folder) by the command-file-matching script to "vomit out" which annotator file would go with file nastynewfile.jpg, f'r'instance. The script I had been using for this task looks like this:

Code:

while read 'line';
do
sp=$(echo $line)
vc=$(echo $sp | cut -d"," -f1)
cv=$(echo $sp | cut -d"," -f2)

[code]....

Where I seem to be stuck is with how to sort the lines in templist, which may be any number of different lengths, from back to front. sort -k looked promising, except it seems only to work the other way round. I thought of invoking a

Code:

q=$(expr length $line); echo $q
n=$[q-8]; echo $n

kind of thing, but that presented the problems of how to sort by those, how to tell sort where to find them (grep?) and how to "stitch them back in" to the original list, which is what I want to sort in the first place.

View 14 Replies View Related

General :: Find The Failed Position Of CD While Taking Backup?

Aug 7, 2010

I am working in ubuntu 9.x (linux karmic kernal) .I have restored the content from CD to hard disk. In the mid way of this process, it was failed. I would like to know this below thiongs,

1) which position it got failed ?

2)Any offset option is there in linux to point the particular CD position ?

View 1 Replies View Related

Ubuntu :: Control Mouse Position From Command Line?

May 17, 2010

Is it possible to control the mouse position from the command line? I want to centre the pointer in the middle of the screen

View 8 Replies View Related

General :: Command Line - Use Find To Find Text Files?

Jul 15, 2011

Is there a way to specify to find that I only want text files (and not binary files)? Grep has an option to exclude binary files, so I thought find probably has a similar feature, but I've been unable to find it.

View 2 Replies View Related

General :: Sed Adds A Space Instead Of Tab At End Of Line

Jan 14, 2011

The objective is to read a file line by line, add a tab at end of each line and add a value(number) after the tab.

My script:

Code:

Report.tsv before running the script for the first time:

Code:

At the end of first run, each line of Report.tsv gets appended by a space instead of a tab. On the other hand each line of Report.tsv gets appended by tab at the end of second run onwards.

This was realized when Report.tsv was imported in open office spreadsheet. First set of appended values get merged into the original column (Strings) and the subsequent appended values fall in distinct columns.

View 12 Replies View Related

General :: List Output In Single Line (space Separated)?

Feb 1, 2011

got a situation where if i process a command i get a numeric output something like below:

for example:

# cat example.txt
856589
856470
987866
656658
876897

now i want to see this output in single line like below:

856589 856470 987866 656658 876897

how do i get this?

View 10 Replies View Related

General :: How To Find Which Programs Are Using Up Swap Space

Jun 10, 2010

How can I figure out which programs are using up swap space? My current memory usage is 2.9GiB out of 3.0GiB used(and I though I had 4GB, I need to check into that) and 1.3Gib of swap used.

View 1 Replies View Related

General :: Find Out Processes Are Using Swap Space?

Jun 21, 2011

I have a linux server top reports about 9GB of swap used:But I cannot figure where's it use swap, some google results said that top - O commad follow by p will show swap usage by process. But as shown in the above image, taking a brief sum of the SWAP column shows that > 10GB of swap is used, so where does the 9GB figure for swap usage come from? Top reports that about 96492kb of ram is used by buffers. Is there anything I can do to utilize this, instead of using swap?

View 1 Replies View Related

General :: Find Which Files Are Suddenly Taking Up The Space?

Jul 27, 2010

I had this come up in logwatch: /dev/sda5 4.8G 3.6G 960M 80%/

Any ideas how I can find which files are suddenly taking up the space?

View 17 Replies View Related

General :: Find And Decrease File System Space For RAC Servers?

Dec 29, 2010

We have recently built some RAC (OS:RHEL55) servers and after the Oracle guys have installed their application, somehow the directory / is using the maximum space. I contacted the Oracle team & they say that their RAC installation doesn't create any files in the / directory. This is the o/p of '/' directory file system:

Filesystem Size Used Avail Use% Mounted on
/dev/mapper/datavg-vol2 498M 382M 62M 88% /

Also, when I checked the file sizes, I found that the following files were taking more space:

/etc/selinux/targeted/modules/active/
-rw------ 1 root root 17M Nov1 base.linked

[code].....

I don't know what these files are doing there, when I did a cat and cheked, I found the files containing this data:

nf_tre--

stem_dbusd_var_run_t...and some stuff like this Unable to decide whether or not to remove these files. Also, is there any way to find out what files are taking more space and whether they can be deleted or not? in order to free up some space in the / direcoty. As there are 10 RACs that we've build, I got to do something to fix this for all of the 10 servers.

View 4 Replies View Related

General :: Use Find To Select Users With A Certain Amount Of Disk Space Usage?

May 16, 2011

I want to find all users shown in the /home/ directory whose disk consumption is more than 500MB. The following command works as expected.

cd /home/ && du */ -hs
68K ajay/
902M john/
250M websites/

From the above example, only 902M john/ should be returned.

How can I make the find command output the same results?

View 4 Replies View Related

General :: Division Of Logical Memory Space In To User Space And Kernel Space

Jan 4, 2010

Logical Memory Space of 4GB is divided in to 3GB User Space and 1GB Kernel Space. Always. Correct?

1. How can we change it? (just changing value of PAGE_OFFSET is okay?)

2. If system have only 256MB of memory (embedded system) and suppose Kernel Modules eat away all the memory during boot. User space will be left will no memory. Is this case possible?

View 2 Replies View Related

Programming :: Scripting To Find Line And Print Previous Line To Out

May 21, 2010

I have a perl/python interpreter available on the system so really as long as the script would run on a standard linux build I'll be happy.So I don't know how to program a script that would find the unique key (which if needed, can be easily stripped out and put into a separate file) and then print out the data below it without going into the other lines.

View 4 Replies View Related

General :: Sed Command - Find Line Not Beginning With Double Quote

Mar 15, 2011

I need to find each line in a file which does NOT begin with a double quote (") and append that line to the previous line. I have been successful doing this using the following command:
cat filname.csv | sed -e :a -e '$!Ns/
[^"]//;ta -e 'P;D' > newfilename.csv

My issue is the substitution. As you would expect after the line is appended to the previous line the first character is removed. I need it to not be removed. I tried:
cat filname.csv | sed -e :a -e '$!Ns/
[^"]/&/;ta -e 'P;D' > newfilename.csv
but it just hangs.

Goal:
Input:
"line 1"
line 2
Output with existing sed command is:
line 1ine2
I need it to be line1line2.

View 9 Replies View Related

Software :: General Protection In /var/log/messages - Find Related Source Line?

Nov 11, 2010

SuSE SLES10, 32 bit. I have an app which crashes with general protection often.

There is message every time in /var/log/messages:
2010-10-22T08:49:49.350476+02:00 HostName kernel: ProgramName[28023] general protection rip:404575 rsp:7fffc5656270 error:0

How do I establish relation between this message and source code? Error was observed on another host where some tests were running, now license is expired and I can't get more info nor core dump. I have to investigate what I have and try to reproduce it locally. Unfortunately original binary was stripped.Now I prepared non-stripped version. Does it has the same addresses for function as original? Is it possible to use symbol information for finding where RIP points to?

View 2 Replies View Related

General :: Command Line - Find External And Internal Devices Attached To A System?

Feb 24, 2010

How can i find through terminal that which devices are external and which are internal.

By external i mean devices attached to USB port. For Example, USB Drive, Portable USB HardDrive etc.

By internal i mean devices attached internally. For Example, SATA Harddisk etc.

View 2 Replies View Related

General :: Find Out The Serial Number Of Hard Disk Through Command Line On OpenSuse 11.2 ?

Jul 12, 2010

I read this thread but

Code:
anisha@linux-uitj:~> su
Password:

[code]...

View 14 Replies View Related

General :: Free Command Line Tool Time Which Can Be Used To Find Timing Statistics For Various Commands?

Jun 24, 2011

I'd like to measure network latency for SNMP GET request. There is a free command line tool time which can be used to find timing statistics for various commands. For example it can be used with snmpget in the following way:$ time snmpget -v 2c -c public 192.168.1.3 .1.3.6.1.2.1.2.2.1.10.2IF-MIB::ifInOctets.2 = Counter32: 112857973real 0m0.162suser 0m0.069ssys 0m0.005sAccording to the manual, statistics conists of:

the elapsed real time between
invocation and termination,
the user CPU time (the sum of the

[code]....

View 3 Replies View Related

Programming :: Disable Irq Line From User Space?

Jul 14, 2011

I have written a device driver and I would like to disable an interrupt. In kernel space there is a function called "disable_irq(int irq)", but, is it possible to do it from user space?

View 7 Replies View Related

Ubuntu :: Quickly Add Swap Space Over Command Line?

Mar 7, 2010

Working with a scientific code that uses more RAM+swap then i generally have (system has 12GB RAM + 24GB swap, but this thing is crazy)It's kind of a one use problem, so I'm not looking to get more RAM, is there a quick way to add more swap space (not on the swap partition, because i have that set at 24GB) so that my system can use it immediately?I don't want to drive up to the office tonight to get this fixed, so a command line setup would work best.

View 7 Replies View Related

General :: Cache File's Name And HD Position?

Jul 1, 2011

I'd like to improve my computer's performance by storing files' system location (e.g.: /home/user/speech.odt) and HD position (head, sector, etc) and do the computer use that info from ram memory.I have a directory with several files and when I cd and ls it, it takes a while to the computer answer me. Plus, it would return immidiate find results.

View 2 Replies View Related

General :: Ubuntu Forgets Program Position?

Jun 29, 2010

After installing Ubuntu 10.04 on an nvidia dualmonitor system there is a weird behavior. Every program starts in the middle of the two dual monitors (overlapping both).

View 1 Replies View Related

General :: Why Is Vim Not Remembering Position In File Between Runs?

Dec 3, 2010

I'm using vim 7.2.330 on 64 bit ubuntu 10.04, sometime in the last week every time I reopen a file it places the cursor at the top of the file. I can see in ~/.viminfo where it's saving the last position used, but it doesn't seem to be honoring it.

View 1 Replies View Related

General :: Launching ZENITY On A Given Position On The X11 Screen?

Dec 5, 2010

how to pass the position to zenity to be launched specific place of X11? No info are given [URL]

View 3 Replies View Related

General :: Physically Adjust Position Of Dashboard?

May 29, 2011

I'm new to the Linux OS, and this is also my first post on this form. My question is Can you physically adjust the position of the dashboard? I'm familiar with Mac OS X where you could "Physically" adjust to the top, left, right or originally at the bottom. Is it possible and if it is, can someone explain to me the process on going about that?

View 7 Replies View Related

General :: Numerical Encoding Of Text, By Position?

Apr 26, 2010

I have a file of words and want to encode them in a numeric form, based on position.This is best explained by example:
PEOPLE ==> 123152

Reading left to right:
P was first encountered at position 1 so it is encoded as 1.
E was first encountered at position 2 so it is encoded as 2.

[code]...

View 5 Replies View Related

Ubuntu :: Cannot Find My Web Space

Mar 21, 2010

Apache is installed and working fine using localhost. Php already installed in ubuntu, however i cannot find the directory where apache is installed so as to save my web pages there. server cannot interpret php files.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved