Jump to content

compressing dirs


Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...