grep `whoami` $1 >> file
this lets me take out the username from a file and then i move it to a file but i need it to do one step at a time because i want the occurences to be numbered like
1)HOME=/home/joe.bloggs
2)LOGNAME=joe.bloggs
instead of just
HOME=/home/joe.bloggs... (1 Reply)
Hello,
I have a file that lists a few hundred values.
Example:
abca
abcb
abcc
abcd
I have a 2nd file with a few thousand lines. I need to remove every line from the 2nd file that contains any of the values listed in first file.
Example of strings to delete:
line1 *abca* end of... (1 Reply)
I am special requirements to rename file.
I have files with names like below:
1_firstname1_lastname1.html
2_firstname2_lastname2.html
3_fistname3_lastname2.html
I would like these file to be renamed as below
firstname1_lastname1.html
firstname2_lastname2.html... (5 Replies)
I am trying to remove the lines listed in example File A from File B to achieve File C. Both files are much larger than the examples below. (File B has up to 6,000 lines).
I have searched the forums and I have not been able to find an answer to this particular question.
I tried
grep -v -f... (2 Replies)
Hey guys,
I'm using sed to remove
from a file and using either of this:
sed 's///g'|
sed 's/''//g'|
sed 's/'$(echo "")'//g'|
but those are just deleting '1' from the file, could you please help me with that? (2 Replies)
I have two files like ABC_DEF_yyyyymmdd_hhmiss_XXX.txt and ABC_DEF_yyyyymmdd_hhmiss_YYY.txt. The date part is going to be changing everytime. How do i remove this date part of the file and create a single file like ABC_DEF_XXX.txt. (8 Replies)
Dear All
I have 200 data files and each files has many duplicates.
I am looking for the automated awk script such that it checks and removes the duplicates from the each file and saving them as new files for all 200 files in the respective folder.
For example my data looks like this..
... (12 Replies)
I have a .CSV file when I check for the special characters in the file using the command cat -vet filename.csv, i get very lengthy lines with "^@", "^I^@" and "^@^M" characters in between each alphabet in all of the records. Using the code below file filename.csv I get the output as
I have a... (2 Replies)
Hi Everybody! First post! Totally noobie.
I'm using the terminal to read a poorly formatted book.
The text file contains, in the middle of paragraphs, hyphenation to split words that are supposed to be on multiple pages. It looks ve -- ry much like this.
I was hoping to use grep -v " -- "... (5 Replies)
Hi Folks,
I have a requirement of file management on different servers.
Source Server is SERVER-A.
Two servers will fetch files from SERVER-A: SERVER1 and SERVER2.
4th SERVER is SERVER-B, It will fetch files from SERVER1. If SERVER1 goes DOWN, SERVER-B will fetch pending files from... (2 Replies)
Discussion started by: Raza Ali
2 Replies
LEARN ABOUT DEBIAN
update-service
update-service(8) System Manager's Manual update-service(8)NAME
update-service - add/remove a service to/from system-wide service supervision
SYNOPSIS
update-service --add|--remove service-directory [service-name]
update-service --list|--check [service-name]
DESCRIPTION
service-directory must be a directory to be used by supervise(8), service-name must not start with a dot, and must not contain a slash.
update-service adds or removes the service-directory to the system-wide service supervision provided through daemontools' svscan(8), lists
all registered system-wide services, or checks for a specific service-name whether it is registered.
When adding a service, and the service-directory resides in /etc/, update-service makes sure that the ./supervise/ subdirectories in the
service-directory, and the optional service-directory/log/, are symbolic links pointing into /var/lib/supervise/, unless they already are
symbolic links.
OPTIONS --add | -a
Add the service directory service-directory to the system-wide service supervision, under the name service-name. If service-name is
not specified, update-service will use the basename of service-directory. You can use the svc(8) program to control the newly added
service, and the svstat(8) program to query its status, e.g.:
# svstat /etc/service/service-name
--remove | -r
Remove the service directory service-directory, which has been added under the name service-name, from the system-wide service
supervision. If service-name is not specified, update-service will use the basename of service-directory. When removing the ser-
vice-directory, the exit command is sent to the corresponding supervise(8) process, telling it to take the service down and exit
afterwards. You can use the svc(8) and svstat(8) programs to control the removed service, or query its status, e.g.:
# svstat service-directory
--list | -l
If service-name is specified, update-service checks whether service-name is registered as system-wide service, prints a message and
exits non-zero if not, or prints the service-name and the directory it points to and exits zero if yes. If service-name is not
specified, it prints the names of all system-widely registered services, one per line.
--check | -c
The same as --list, but update-service doesn't print anything to standard out or standard error.
ENVIRONMENT
SVDIR The environment variable $SVDIR overrides the default services directory /etc/service/.
FILES
/etc/service/
SEE ALSO svc(8), svstat(8), svscan(8), svscanboot(8)AUTHOR
Gerrit Pape <pape@smarden.org>
update-service(8)