Ubuntu :: Delete All Text Before Period?

Jun 7, 2011

I have a file like this code...

I would like to use sed or similar to remove everything before the period, but only for the lines 1 and 3 (or lines with a-z.a-z and not a-z = 0-9.0-9.0-9.0-9)

I found a way to do this using:

cat $file | sed 's/[.].*//'

But this 1)remove all the text AFTER the period and not before it, and 2) removes everything after the first decimal of the IP address.

View 9 Replies


ADVERTISEMENT

Ubuntu :: Changing "keypad Delete" From Comma To Period

Jan 10, 2010

I am using Ubuntu 9.10 in U.S. English with a German keyboard layout. Accordingly, pressing the delete button on the numeric keypad will produce a comma, which most applications do not recognize as a decimal. in order to have the key produce a period.

I have tried editing the /usr/share/X11/xkb/symbols/de and changing the line

Code:
include "kpdl(comma)"

in the "basic" section of the file to

Code:
include "kpdl(period)"

which seemed like the perfect solution, but upon restarting an error message pops up and the keyboard layout is changed to U.S. English.

Code:
cd /usr/share/X11/xkb/symbols
xkbcomp -lhlpR '*' -o ../symbols.dir

which does nothing at all if used with sudo and produces an error message if used without. Reverting changes to /usr/share/X11/xkb/symbols/de removes all errors.
Is there something else I need to do to have xkb accept my changes to the file?

Code:
include "kpdl(comma)"

does not specify a symbol to be mapped to the keypad delete key, but rather constitutes a command that integrates a pre-specified option into the layout file. Thus, simply removing the line works perfectly well, even without using the above suggestion to register the change to the file with xkb (or whatever it does).

View 7 Replies View Related

Programming :: Delete Line Of Text From Text File Via Shell?

Jan 13, 2010

I have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.

View 3 Replies View Related

Ubuntu :: Delete All Files Listed In A Text File?

May 26, 2010

Through various Windows reinstalls and switches within Linux distros, I have a massive amount of duplication within my music archive (on the order of 7+ dupes of each file). Now, I found a lovely program called "fdupes" and was able to build a list of all the duplicate files, and I'm trying to use "xargs" to remove then. However, when I try and run the command "xargs -0 --arg-file="dupes.txt" rm" or "xargs -0 rm < "dupes.txt"" it give me the following error: "xargs: argument line too long".

how perhaps a different way of accomplishing the same thing?

View 9 Replies View Related

Ubuntu :: 10.10: Delete Graphic With Text 'Unknown' On Screen?

Nov 17, 2010

Having recently looked at my monitor property using <Preferences> <Monitors> I now have a small pink rectangular graphic at the top left corner of my screen which hides the first part of the launch panel, as well as the main controls on any window placed in this position.

This graphic is identical in colour and content to that presented by the <Monitors Preferences> app. How do I delete it? It's not click-able drag-able or editable. It doesn't even appear to be a window.

View 2 Replies View Related

Ubuntu :: Bash Script To Delete/replace A Specific String Of Text?

Jun 17, 2010

What i want to do is pretty simple.I want to uncomment every line that begins with "deb" (except for deb cdrom) in /etc/apt/sources.list.I know how to do this through system > administration > software sources.I know I can gksu gedit /etc/apt/sources.list.I'd rather not do it that way.I'd rather have a script do it. It's less work, less typing, less clicking, and would work the same on every ubuntu version.

View 8 Replies View Related

Ubuntu :: When Delete Simple Text File / Trash Icon Not Change

Mar 6, 2011

I have installed KDE 4.6.1, on distribution Ubuntu 10.10 . But i have problem with trash icon. Even when i delete a simple text file, trash icon not change, shows empty icon. When I open trash directory location from dolphin, left side shortcuts, it shows empty directory.Is it a bug? Where is my deleted file gone?

View 4 Replies View Related

Fedora :: Delete Character MS-DOS Text Files On System?

Aug 17, 2011

We had seen some time ago, various tricks to remove the character MS-DOS text files on Linux. Here is a new trick to do this directly from the vim editor.
to convert a file opened with vim in UNIX format, simply use the following command code...

View 2 Replies View Related

Software :: Delete Top Lines Of A Text File Until A Word Is Met?

Jul 7, 2011

I need to chop of the top 30ish lines of several log files until a line starting with "Initialization completed."The trouble is that it's not always the same amount of lines that need to be deleted, and they don't always contain the same information, which is why I would need to delete everything priorhe line starting with "Initialization completed."Right now I have a little script I wrote based on looping each file through several "grep -v" commands with each known pattern of lines I want to ignore, but it is tedious and I have to inspect each file afterwards to make sure nothing is left from above "Initialization completed

View 3 Replies View Related

Software :: Find And Delete String In Text Files?

Mar 6, 2010

I have a series of file names in a text file that I generated by running
Code:

bash-4.1# ls -alt *.txz | awk '{print $8}'
and then copy pasting the output. All of these file names have the version number
Quote:
-4.4.1-x86_64-1alien.txz

I just want a method to remove that version number from all the filenames so that I can then add all the packages without version numbers to a blacklist file.

I've tried kwrite and mousepad and both have a search feature and a replace feature but I haven't been able to just have the text removed successfully.

View 3 Replies View Related

Programming :: Shell Script To Delete Part Text Of A Line If Pattern Matches?

Apr 12, 2010

I am trying to create a shell script, on taking a input file as parameter, which need to do 3 things

1) create a copy of existing file.

2) add a new line to the copied file.

3) strip off all the absolute paths inside the copied file

The first 2 points are straight forward. but i am finding it difficult to acheive the 3rd point. myself not very good with awk and sed. but gave it a shot in vain. For example, the input script consists of below,

PROGRAM=`/usr/bin/basename $0`
HOST=`/usr/bin/uname -n`
echo Start $PROGRAM `/usr/bin/date` |
/usr/bin/tee -a $LOG

The output of the script should look like,

PROGRAM=`basename $0`
HOST=`uname -n`
echo Start $PROGRAM `date` |
tee -a $LOG

View 14 Replies View Related

Programming :: Perl - Delete Line From Text File With Duplicate Match At Beginning Of Line

Apr 1, 2009

Was wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):

There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.

If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.

View 7 Replies View Related

Red Hat / Fedora :: Edit A Text File To Delete All Commas In The File?

Jan 4, 2011

i want to find a command line way to edit a text file to delete all commas in the file. i do not want to replace them w/ anything.

View 2 Replies View Related

Ubuntu Servers :: Run-parts Does Not Run Scripts With A Period In The Name?

Sep 2, 2010

Ubuntu 10.04.1 LTS: It appears that run-parts does not run scripts with a period in the name. I had a script upg.sh which run-parts did not recognise; when I changed it to upg it did. This is surely a bug!

View 3 Replies View Related

Ubuntu Networking :: Unable To Get Another Lease, Period

Nov 15, 2010

I've been trying to figure out a strange DHCP problem my girlfriend's having: She can only get (or renew) a DHCP lease once; Subsequent tries timeout. I tried switching from network-manager (which uses dhclient) to wicd (dhcpcd), and noticed a key difference: With wicd, restarting helps (again, works once, then another restart is required). With network-manager, I haven't been able to get another lease, period.

Exploring the dhcpcd case further, I found that suspend/hibernate do not correct the issue; a full restart is required. Neither does `/etc/init.d/wicd restart` help. I don't remember if I tried killing dhcpcd; I'll have to test that. The current workaround is to restart the computer after each disconnect. It's pretty annoying, though, so I'd like to try to collect enough specifics to file accurate bug reports for each dhcpcd and dhclient. Is anyone familiar with these projects? Are these known issues? Any ideas how to hone in a bit? My gut tells me there's some state somewhere that needs to get flushed.

View 2 Replies View Related

Ubuntu :: Freezes After A Period Of Inactive Time?

Dec 16, 2010

I installed ubuntu 10.0.4 TLS version and my desktop freezes after a period of inactive time: the screen doesn't change and the apps do not response. It will resume after any key-stroke or mouse action. Is it a feature of 'power-saving' or something else? I need my ubuntu keep 'alive' all the time.

View 2 Replies View Related

Ubuntu :: 10.04 Hangs Unexpectedly After Certain Period Of Inactivity (4-5 Minutes Maybe)?

Jun 29, 2011

Please help me to resolve th problem stated underneath:My computer(P4, 512MB RAM) running Ubuntu 10.04 hangs unexpectedly after certain period of inactivity (4-5 minutes maybe). I checked power management settings and all power saving options are set to off.The screen says Checking battery state comes for a while... and then black screen with stripes comes. Monitor also goes off for say a sec or two.Then monitor goes 'on' on its own .This process of Black screen with stripes, monitor off and on goes on until I "Reboot"

View 9 Replies View Related

OpenSUSE :: Automatic Log-off After Period Of Disuse?

Nov 30, 2010

How do i configure my KDE in openSuse11.3 so that the user is automatically logged out if no ones on the machine for a certain period of time?

View 3 Replies View Related

Networking :: Timeout In All Connections After A Period

Jan 11, 2011

I installed linux 2010 mandriva on a (embeded) system,and i run several server programs on it that accept connections from clients. clients are connected to server(s) and every things is ok, but when i go to home and back to my work tomorrow, i see no data can be sent to server programs and this problem exists until i restart the server programs or reconnect tcp client programs. this problem occurs even when both client and server programs executed on the same (embeded) system.why this happens? i checked by netstat and see that server ports exists in the list(and not closed by kernel) but it seems kernel or an application above it prohibit data transmission.i changed the OS and installed ubuntu but the problem exists.

View 5 Replies View Related

General :: Calculate The Hours Usage Per Day Over A Certain Period?

Dec 13, 2010

Between the dates 21-June-2007 to 12-December-2010 there are 1270 days. If the total cumulative time a hard drive has been active is 344 days (found this via Disk Utility in Ubuntu 10.10) since it was bought 1270 days ago. What is the average usage hours per day?

View 2 Replies View Related

General :: Calculate Time Period In Scripting

Mar 16, 2011

Now i am writting one bash script. in that my requirement is i need to create one directory and that the directory details to be stored in one file Ex. date/time and all in one file. after that i need to delete the folder automatically exactly after 3months. between these time period in 2month itself i need to send one mail to admin "regarding this still one month only more to delete the folder" . is it possible to do like that date calculation in script.

View 10 Replies View Related

Software :: Processor Utilization During Peak Period

Jul 1, 2010

How i can know processor utilization during peak period in rhel 5.3.

View 5 Replies View Related

Software :: What Is The Existing Period Of Character String In C++/c

May 18, 2010

Like the following c++ program, I define a pointer of char type in the class named "test". In the function init1(), str="hello1" , what is the existing period of "hello1". Whether the string "hello1" will be invalid if the function init1() exits ? then "str" point to the invalid field in memory. When will "hello1" and "hello2" be released by OS ?

Where is "hello1" stored in memory?

Code:

When will "hello everyone" be released?

View 1 Replies View Related

Ubuntu :: Instability In Karmic \ Lock Up Every Time It Had A Period Of Extended Inactivity?

Jan 21, 2010

I skipped over Jaunty on my main desktop because Intrepid had been working perfectly for so long. Finally took the plunge to Karmic, and have had major instability problems. I cannot trace them to any particular program I am using. At first it seemed related to power management, since it would lock up every time it had a period of extended inactivity. I have disabled ACPI in my BIOS (I think), and any power management settings I could find in gnome to try to troubleshoot. That seems to have helped, but it still happens semi-regularly, sometimes when I am in the middle of using it. I have tried checking logs and googled anything that seemed important. ie a message in kern.log reads: Clocksource tsc unstable

View 2 Replies View Related

Servers :: Ubuntu 10.4 Server Stops Accepting Connections After A Period Of Time / Fix It?

Apr 24, 2011

I'm not sure if this belongs in the Server or Networking section of the forums. Anyway, last month I upgraded my server to Ubuntu 10.04 LTS. Since then, I've had a recurring problem wherein after a certain period of time, the server stops accepting network connections. Ubuntu 10 will continue to reject network connections until someone logs into the server locally, after which time network connectivity is restored and the cycle begins anew. Essentially, the server goes into a "half sleep mode". I say half because the computer is still on and the fans are running.

I've done some searching around various forms and initially figured this issue was related to problems with the Network Manager service (https://bugs.launchpad.net/ubuntu/lu...er/+bug/524454), so I removed the service altogether. However, this problem is still occurring.

I've poured over /var/log/messages and /var/log/syslog, but have noticed no irregular behavior. Has anyone else experienced this issues? I'd rather not resort to downgrading back to Gusty Gibbon if I can help it.

I am happy to provide more information if its needed

View 4 Replies View Related

Ubuntu :: Change Delete Button To Delete Instead Of Move To Trash

Apr 18, 2010

Instead of moving to trash, how can i make the delete button delete? Delete is already enabled on the right click menu.

View 7 Replies View Related

Ubuntu :: Folder Wont Delete \ Whenever Try To Press Delete Noting Happens?

May 9, 2010

SO after using Testdisk to recover some images, the folders recup_dir.1 & 2 have saved in my FIle System area, when ever I try to press delete noting happens. I have also tried rm -f -rrm -f -fIt still dont delete, I have also deleted my user account and made a new one, but the files are still there.

View 4 Replies View Related

Ubuntu :: Rsync --delete Doesn't Delete Superflous Files

Sep 25, 2010

I am trying to use an old box as backup server. I have tried a couple of possibilities along the lines of:

Quote:

rsync -a --delete --progress --log-file=/home/$USER/info.txt -e ssh /home /etc root@192.168.0.106:/mnt/back

The problem is it does not delete files that has been removed from my local system?
I run the command as root on the local system.

(I realize I should properly not ssh into the server as the server's root but I'm having trouble with the permissions and I want to make sure everything else works before messing around with it)

View 2 Replies View Related

Debian Installation :: Window Flash For Very Brief Period And Then Disappears

Aug 19, 2011

During my upgrade this fine afternoon, my system went into screensaver mode and would not bring up the security window. The window would flash for a very brief period and then disappear. I tried to enter the password to no avail. After 10 minutes of this, I gulped and re-booted. It seems to boot ok, but just like in the install, the login security window flashes and disappers. I have tried to type in the data with no luck. Does anyone have a work around? I am currently using my knoppix live disk until I can burn a deb live disk.

View 11 Replies View Related

Fedora :: Reinstallation - Display Does Not Shut Off After A Certain Period Of Time

Feb 28, 2010

I just reinstalled, and can't get the setting set right so that my display does not shut off after a certain period of time. It is shutting off after a while of inactivity, and I do not want it to.

View 2 Replies View Related







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