General :: Gzip Command To Append Some Files
Feb 21, 2011I have a existing zipped file , I want to use gzip command to append some files to it , I tried man gzip but can't find the key word "append" , can advise how can I do it ?
View 1 RepliesI have a existing zipped file , I want to use gzip command to append some files to it , I tried man gzip but can't find the key word "append" , can advise how can I do it ?
View 1 RepliesI am using openSUSE 10.3.When I install software from tarball then to record time required I send output of date to beg.txt(when installation begins) and end.txt (when installation finishes).How can I append output of date to a file so I don't need two files?
View 4 Replies View RelatedI have 100 files: cvd1.txt cvd2.txt ... cvd100.txt
How to gzip 100 files into one .gz file so that after I gunzip it, I should have cvd1.txt, cvd2.txt ... cvd100.txt separately?
I have a script which periodically backs up a directory using the command "tar -czvf [name] [directory]" but my problem is that the script has recently been putting a lot of stress on the server (Minecraft SMP) and tends to lag players as it backs up, which recently has been taking nearly 5 minutes.So I need to know if there's a way to control the GZip compression rate at the same time that it archives and backs up the files?I understand that I can first tar the files and then GZip them separately with a different compression rate afterwards, but this would not work because it names the files with the current server time, which sometimes changes in between commands.
View 1 Replies View RelatedI sometimes get confused by the varying command line options I need to run common Unix archiving and compression software (e.g. gzip, bzip2, zip, tar).
Is there a program out there that can just Do What I Mean for common cases? For example:
eed to make a script to append a line to the bottom of multiple files (only certain files, but 100's spread over directories).Doing a find replace inside multiple files is easy, I use the followingfind /base/dir -name "*.txt" -exec perl -pi -w -e 's/FIND/REPLACE/g;' {} ;So I tried doing the followingfind /base/dir -name "*.txt" -exec echo "Append this" >> {} ;However this just appends all the text into a file called "{}". Whereas {} should be replaced with each file that's found.
View 1 Replies View RelatedI wanted to be as clear as possible. I have to add hundreds of new servers to hundreds of configuration files in Nagios. Here is a sample structure:
servers.txt has:
SERVER3
SERVER4
[code]....
I have limited access to several servers (key based auth) but cron facility is not available for me. Those servers getting filled up by large apache logs and I have to login to each node manually and clean them each and every day.
I tried to write a script to run from login box but when i try that it looks like it is looking for logs in the local server (login box).
So current situation is:
How can i modify this so that the script in server1 will look for files in that server and zip them?
Google showed another command called rsh but in my env it is also not avil.
I have the following command that works Code: ssh root{at}IPADDRESS 'vim-cmd vmsvc/power.getstate 64 | grep Powered | awk "{ print $2}"' Which outputs the following text:- Powered on I would like to Append some text so the output is:- Ubuntu Server: Powered on Every different variation that I have tried ends up in an unexpected token.
View 1 Replies View RelatedI have installed debian on my dell latitude d630 laptop and am currently making a derivative for others to use. however I can't get the wireless to work. I downloaded it from the broadcom site but it comes as a gzip file instead of a deb file. if I extract the gzip file I don't get any installable (deb) files. I need the wireless to work because now a bridged network from my windows laptop isn't working.
View 3 Replies View RelatedIs there a vim command or sequence of commands that will append the current line into the clipboard? Given the example below:
4
5
3
1
2
Lets say I wanted to cut 3, 4, 5 (in that order) then paste them below 2 so that the numbers are in order?
may be an advanced question but I need to know how to do this. Here at work I am in charge of recruiting and we have about 1,000 resumes in already. All of the resumes are in a .pdf format. I need to rename every .pdf in the following format:{firstnameLastname}.pdfThe only way I know how to do this is to convert all the .pdf files to text, extract the name out of the first few lines of text, import into excel, and then use VBA to rename the files in mass:Here is my logic so far:~Deskop/a = houses all the .pdfresumesOpen terminal: Code: cd ~/Desktop/afor f in *.pdf; do pdftotext -raw $f; done That will convert all of the preceding resumes into text filesNow I would like to append the name of the text file into the last line of the text file. So, for example, for Resume1.txt, I want to append "Resume1.txt" to the last line within Resume1.txt. So after I run the command I open Resume1.txt and on the last line within I want to see "Resume1.txt" on the last line, at the end of the resume.How can I do this? I would like to use a loop and have the terminal append the filename to the body of the text file until all of the have been appended.
View 1 Replies View RelatedHow to list all the files that don't contain pattern1 and append a new line (pattern1) to those files before pattern2 only once.
pattern1 = /var/script/showMessage.sh
pattern2 = ;;
Code:
grep -c 'pattern1' /var/script/*_cam* | grep :0 | add pattern1 before pattern2 in each file loacted before.
I'm trying to download a large (~18Gb) file using rsync from a server to a client, but the server, for an unknown reason, kills the connection after a time, when I've downloaded only about 8-10Gb.How can I continue the downloading of this file?
I've tried using the --partial option, but it just restarts the download from zero again. I've tried adding "--append" but I get "rsync: on remote machine: --append: unknown option" because the version is 2.6.3 on the server (and 3.0.6 on the client). I don't have control of the version on the server.
Will unzipping always append files if the directories already exist? What about tar?
I unzipped an archive the archive had 3 folders and dozens of subfolders within those. app, skin, js
The folder I unzipped it to also already had those 3 folders as well as many child folders etc.
My website is still working so I'm just wondering. Is this safe or is there anything I should worry about. The other option was to manually upload each file manually that is in those 3 folders and the dozens of sub folders.
If I need to append a set (or sets) of data to a file(or files) on remote hosts what is the best mechanism by which to do that? My first thought was ssh but the command syntax to append to a remote file isn't clear to me. Can anyone point me in the right direction here?
View 4 Replies View RelatedI'm setting up a network between 2 pc's where the one should act like "file server" and a normal pc to surf on internet.called ORLA-DESKTOP and the other pc is called OLGA-DESKTOP a pc connecting to the server and automounting the shared folder to the desktop Both pc's run ubuntu 10.04 Lucid Lynx The shared folder is located on the server in /home/orla/svenson
ORLA-DESKTOP have 2 users "olga" and "orla" in a group called "svenson"
OLGA-DESKTOP have 1 registered user "olga" also in group called "svenson"
users on ORLA-DESKTOP can read/write/append and so on and fully manage everything in the shared folder.But on OLGA-DESKTOP the user can make a file on the pc and then drag'n'drop the file the the shared folder, and can also delete files in the shared folder. but cannot create a file directly into the folder like on ORLA-DESKTOP I have 3 configuration files made. 2 for automounting, Located on OLGA-DESKTOP 1 for samba server configurations located on the server ORLA-DESKTOP
The first one is /etc/fstab
Code:
# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
[code]....
To sum it all up the real problem is that OLGA-DESKTOP can't append to files in the shared folder. but users on the server have no troubles doing it..
Given a gzip compressed file, how do I know what compression level (1-9) was used for it?
View 2 Replies View RelatedI want to be able to write a shell script for downloading files (only *.tar extension) from multiple folders (the sub folder's names may vary) in a FTP site and be able to untar them and then gzip them and then move them to the real folder.
View 4 Replies View RelatedDoes gzip have the capability to decode gzipped traffic? I have been beating my head against the wall with this issue. What I'm trying to do is capture traffic between a web server and clients, and I've got it set up where it's redirected to a file for ease of grepping, however it's seemingly incapable of decoding gzipped encoding. I know I can do this with tshark, I'm curious as to whether tcpdump has this capability (i.e. only using tcpdump, and not some additional tool like tcpshow or what-not).
I can't find much on this issue in the man page for tcpdump, but it is fairly lengthy, so it's possible that I missed something, but I don't see that as especially likely.
I have a backup script basically is this
Code:
BACKUP_DIRS="/etc /boot /root /home"
BACKUP_FOLDER="/tmp/system_backup/
for DIR in ${BACKUP_DIRS}
do
[code]....
All the folders get dumped into seperate gzip files. Now I want all the gzip files in the backup folder into one final gzip or bzip2 file. My goal for this is to get one file instead of multiple so I can scp or ftp the one file to another file share. Which would be easier to send one file than a bunch of files.
I need to find TCSH shell and gzip version number by running a acript on several boxes through ssh. How can i do that? I made a script for tcsh but it is not working by ssh , it only works on my box . I dont know from where to find the gzip version info.
View 5 Replies View RelatedI know similar questions have been asked before but I cannot seem to get it to work.I have a file file.something.nhMMYY that i need to ftp (MMYY being Month and Year)I want to add something into the script to auto-magically insert the MMYY.
View 8 Replies View RelatedI'm doing an assignment for school, and while we have not yet learned regular expressions, my teacher would like us to use AWK to append text to certain lines in a file. What we've had to do is creating a listing of all links and directories in the /etc folder and place them in a text file. From this, we were to cut the first field (Permissions) and the ninth field (filename) and create another text file. Now the part that I'm struggling with is this and I'm not sure if I should be using sed or awk. We're supposed to ADD the text "DIR" to the beginning of any line that is a directory, and "LNK" to any that is a link, like so:
DIRdrwxr-xr-x redhat-lsb
DIRdrwxr-xr-x rhgb
LNKlrwxrwxrwx rnDIRc.key
DIRdrwxr-xr-x rpm
Obviously, I realize that the first character in the permissions denotes what sort of file it is, hence when I created my text file I used
ls -l | grep "^d" > file.txt
and
ls -l | grep "^l" >> file.txt
I'd like to learn how to properly do this, but struggling through pages on the internet hasn't been helping, nor has the --help command. Therefore, while I would like the answer, I'd also like to know what the heck I'm doing For example, I know I could delete lines with regex using d/[STUFF I WANT TO DELETE]/g (To get rid of all occurences) and I can substitute using s/foo/bar But I'm unaware of anyway to ADD text upon certain occurences, let alone two different circumstances.
I am trying to upload an IOS in the cisco NAC Appliance. The IOS version has to be updated as 4.8. I am getting the below error when i tried. File is not in gzip format Child return status 1 Error exit delayed from previous errors. I am using the below command to unzip the IOS file. tar xzvf ccca_upgrade-4.8.0-from-4.6.x.tar.gz.
View 3 Replies View Relatedhave a gzip file ABC_000023232.gzipBCD_023232032.gzipI want to split these files into smaller files but keep the extension same because I am using this as a variable in a script
Code:
for i in `ls *.gzip`
split -b 500K $i $i
[code]...
the query is ||| how to append a char | string |||
#!/bin/bash
echo -n "one""two""three"
#END
above method is working well but below method is not working ?
#!/bin/bash
one=one
two=two
three=three
echo -n $one$two$three
#END
i just want to create a folder with current time.
For example.
foldername_09042010 How do i modify mkdir or write script to do this?
Greetings, I want to automatically append flags to certain commands. For example, when I type:
ls
at the prompt, I want the
-la
flags automatically appended without me having to type:
ls -la
we have centos and a win2k8 server. Our pos system is on the centos server. I created a HOST (A) record on win2k8. so users don't have to remember the ip address of the centos server.so i created a friendly name like URL... and the POS web page will be loaded.but my questions is it possible to configure the centos to automatically append the port number if the user type URL... will be auto added at the end of it.
View 3 Replies View Related