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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...