- Date : 2017-05-17
- Tags : #sysadmin #compressing #rar
All unicode filename will be transform to weird character, so it makes broken paths and broken links
rar and unrar in Linux isn't same version and so don't use unrar to extract archived file by rar (It causes invalid full paths)
Ubuntu :
$ sudo apt install rar
Redhat ( using RPMForge )
$ sudo yum install rar
Compressing files
$ rar a result.rar file1 file2 file3 fileN
Compressing dir and its subdirs (remember with trailing slash in the end)
$ rar a -r result.rar folder1/
Locking RAR file with password (adding -p"THE_PASSWORD_YOU_WANT"
)
$ rar a -p"0cOP@55w0rD" result.rar file1 file2 file3 fileN
$ rar a -p"0cOP@55w0rD" -r result.rar folder1/
Listing content of RAR file
$ rar l result.rar
Extracting RAR file to current dir
$ rar e result.rar
Extracting RAR file to current dir with fullpath
$ rar x result.rar
Asking it !
$ rar -?
WHAT IF I TOLD U THAT A RAR FILE BIGGER 35 TIMES THAN ITS ORIGINAL FILE ?
$ echo 'a' > a.txt
$ rar a a.rar a.txt
RAR 3.80 Copyright (c) 1993-2008 Alexander Roshal 16 Sep 2008
Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive a.rar
Adding a.txt OK
Done
$ ls -al
total 72
-rw-r--r-- 1 root root 77 May 17 14:18 a.rar
-rw-r--r-- 1 root root 2 May 17 14:17 a.txt