file name employee.txt where I have a ^M at the end of the file , i can remove ^M usind sed
Solution 1Example 1 :
Code:
sed 's/ ^M/ /gi' employee.txt
Solution 2 Example 2 : :
Code:
1,$s/ ^M/ /g
But here is a catch on 1 thing ,where we need to apply the same concept to a entire folder where we have more than 50 file having the same problem of ^M to be removed , how can we do that ?
Problem :
Code:
ls -lrt /root/sunny1/
-rw-r--r-- 1 root root 3325 Dec 7 2011 install.log.syslog
-rw-r--r-- 1 root root 26725 Dec 7 2011 install.log
-rw------- 1 root root 949 Dec 7 2011 anaconda-ks.cfg
-rw-r--r-- 1 root root 1071 Oct 30 20:13 emplst.sh
drwxr-xr-x 2 root root 4096 Dec 10 20:51 Desktop
-rw-r--r-- 1 root root 1669 Jan 10 17:53 natasha_access.sh
-rw-r--r-- 1 root root 108 Jan 10 17:54 natasha_others
-rw-r--r-- 1 root root 109 Jan 10 17:56 last_sasha.sh
-rw-r--r-- 1 root root 140 Jan 10 18:02 emplsts_1_4.sh
drwxr-xr-x 2 root root 4096 Jan 10 18:33 redhat
-rw-r--r-- 1 root root 812 Jan 10 18:37 emplsts.sh
-rw-r--r-- 1 root root 59 Jan 14 18:52 emp1.sh
-rw-r--r-- 1 root root 549 Jan 19 12:55 employee.txt
-rw-r--r-- 1 root root 549 Jan 19 13:14 n_employee.txt
-rw-r--r-- 1 root root 507 Jan 19 13:20 f_employee.txt
[root@localhost ~]#
Last edited by Scrutinizer; 01-19-2013 at 05:18 AM..
Reason: code tags
Hi there
I have a file which has the lines
# Serial number for hostid
EXP_SERIAL_=""
These lines could be anywhere in the file as far as line numbers go, I would like replace these two lines with
# Serial number for hostid $var1
EXP_SERIAL_$var1="$var2"
Is there a quick and simple... (6 Replies)
Hi,
I'm attempting to rename some files that have spaces in them. Without linking sed commands together is it possible to replace the first three "." to " ".
File.name.is.long.ext -> File name is long.ext
I can get the desired effect with
echo "File.name.is.long.ext" | sed 's/\./ /g;s/... (5 Replies)
sed -e "s// /g" old.txt > new.txt
While I do know some control characters need to be escaped, can normal characters also be escaped and still work the same way? Basically I do not know all control characters that have a special meaning, for example, ?, ., % have a meaning and have to be escaped... (11 Replies)
Hi friends,
This is sed & awk type question.
I have a text file which has numbers spread all over the file. I want to sum the series of numbers whenever i find it and produce an output file with the sum. For example
###start of input text file ####
abc
def
ghi
1
2
3
4
kjld
random... (3 Replies)
I need to get notification via email when the line containing a pattern is changed in a file. Not during the time any changes to file occurs. Ie if we reset a user password say example, demouser the hash in the line containing the word demouser in the file /etc/group changes. So when this change... (1 Reply)
Hello All,
can someone please suggest me a one line command to change a specific value that is associated to an entry in the file.
for example
#more schedulefile
quartz.job.manual.bonus.schedule=0 0 9 ? * *
#
it should be changed to
#more schedulefile... (5 Replies)
Hi,
I have a text file which is output from a server and it lists all the files in a specific volume. However, the volume name appears as volume_name:.
I would like to replace this with \\volume_name\volume_name. This is not a problem in itself as I can use sed to globally look for the... (8 Replies)
Hey Guys and Gals,
I am having trouble with what I thought shouldn't be hard..
In a script I am working on there is a need to enter a MAC address.
MAC addresses are formatted ;
XX:XX:XX:XX:XX:XX
where X can be 0-9, a-f or A-F
So in the sample script the query is something... (4 Replies)
file1
cat
dog
fish
file2
This is a bunch of lines
<!-- INSERT ANIMALS HERE -->
horse
cheetah
post results
file2
This is a bunch of lines
<!-- INSERT ANIMALS HERE -->
cat
dog
fish
horse (1 Reply)
I have the input file like this.
Input file: 12.txt
1) There are one or more than one <tr> tags in same line.
2) Some tr tags may have one <td> or more tna one <td> tags within it.
3) Few <td> tags having "<td> </td>". Few having more than one " " entry in it.
<tr> some td... (4 Replies)
Discussion started by: thomasraj87
4 Replies
LEARN ABOUT X11R4
systemd-volatile-root.service
SYSTEMD-VOLATILE-ROOT.SERVICE(8) systemd-volatile-root.service SYSTEMD-VOLATILE-ROOT.SERVICE(8)NAME
systemd-volatile-root.service, systemd-volatile-root - Make the root file system volatile
SYNOPSIS
systemd-volatile-root.service
/lib/systemd/systemd-volatile-root
DESCRIPTION
systemd-volatile-root.service is a service that replaces the root directory with a volatile memory file system ("tmpfs"), mounting the
original (non-volatile) /usr inside it read-only. This way, vendor data from /usr is available as usual, but all configuration data in
/etc, all state data in /var and all other resources stored directly under the root directory are reset on boot and lost at shutdown,
enabling fully stateless systems.
This service is only enabled if full volatile mode is selected, for example by specifying "systemd.volatile=yes" on the kernel command
line. This service runs only in the initial RAM disk ("initrd"), before the system transitions to the host's root directory. Note that this
service is not used if "systemd.volatile=state" is used, as in that mode the root directory is non-volatile.
SEE ALSO systemd(1), systemd-fstab-generator(8), kernel-command-line(7)systemd 237SYSTEMD-VOLATILE-ROOT.SERVICE(8)