william Posted April 23, 2004 Report Share Posted April 23, 2004 I've created a folder fulll of icons and was just wondering if it'd be possible to compress it (tar, gzip, zip, rar, etc) through command line at once, instead of going .png file by .png file. I did a google search and found some commands, but unfortunately I didn't succeeded in doing that. Actually, my intention is to back up this folder for a possible future use. Thanks for any inputs. Link to comment Share on other sites More sharing options...
bvc Posted April 23, 2004 Report Share Posted April 23, 2004 (edited) you mean if the icons are in /home/william/icons, and you're in a terminal in /home/william tar -czf icons.tar.gz icons Edited April 23, 2004 by bvc Link to comment Share on other sites More sharing options...
william Posted April 23, 2004 Author Report Share Posted April 23, 2004 that's it, bvc!!! Great help!!! Link to comment Share on other sites More sharing options...
Cannonfodder Posted April 23, 2004 Report Share Posted April 23, 2004 If you want you can make a file called myalias.sh and put it in /etc/profile.d. Inside the file do something like alias maketar=tar -czf Each time you login or open a new command window, the aliascommand will be executed and you can then do type maketar <some folder> I also do this for uncompressing tar.gz, or tar.bz2 or making iso files, whatever. Just easier to type and less to remember argument wise. Link to comment Share on other sites More sharing options...
william Posted April 23, 2004 Author Report Share Posted April 23, 2004 cannonfodder: I did what you suggested, but I should have done something wrong. (I don't know scripting) Here is the script: #!/bin/bash alias maketar=tar -czf Properly saved in /etc/profile.d/, but whenever I lauch the terminal I get this error; -bash: alias: -czf: not found I've already run chmod +x to make it executable, but even then it didin't worked. Link to comment Share on other sites More sharing options...
spinynorman Posted April 23, 2004 Report Share Posted April 23, 2004 I think you have to make that - alias maketar="tar -czf" Link to comment Share on other sites More sharing options...
william Posted April 24, 2004 Author Report Share Posted April 24, 2004 thanks spinynorman: it worked. Link to comment Share on other sites More sharing options...
Qchem Posted April 26, 2004 Report Share Posted April 26, 2004 I'd probably have put the alias in ~/.bash_profile and I tend to use bzip2 compression (substitute the z for a j). Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now