![]() ![]() I tested these snippets using or in: * Linux debian 3.16.0-4-amd64 #1 SMP Debian 3.16. $ for program in tar unzip untar do # You could simply add to this list. You could use variants of this for loop, if you like adventure :-) # In case of compressed files inside compressed files this will I think this should do it: tar -xzf -C /locationX folder1 -C /locationY folder2. Use a looping construct to decompress each file.ĭecompress all files in the current directory: $ for file in `ls -1` doĭecompress all archives in the current directory and any subdirectories (my personal favorite): $ for file in `find *` doĭecompress all archives recursively and do the same again for any remaining: # Make the above loop a function to be called more than once Use bash and the utility find to output to the console a list of all contents from the present directory. The trailing + signify that ACL, Access Control List, is set on the directory.You want to decompress all compressed files inside a directory and all its subdirectories. List directory to see new permissions applied ls -ld html With such software, you can change the default extraction destination, create a new folder for extract files, and automatically open the folders once the. Right click on the white background and select Open in terminal. Right click on the netDb.tar file and select Extract here. Make SELinux if installed, ignore www-data context requirement so it lets allows write permissions sudo setsebool -P httpd_unified 1 Move the netDb.tar file, from wherever you downloaded to, and place it in the opened. sudo setfacl -R -d -m u::rwX -m g::rX -m o::000 html ![]() tar file then just use 7zip or winRAR, these two applications are readily available on the internet, But if you want to do the same operation on command prompt then open the folder where the winRAR or 7zip is installed (c:Program FileswinRAR), there you will get a 'rar.exe' files which u can. This creates the default rules for newly created files/dirs within the html directory and sub directories. If you want to extract the contents of a. Set the GID of html, now, newly created files in html will inherit ownership permissions: sudo chmod g+s html Set read,write,execute permission as required, (ugo) u=user, g=group, o=others sudo chmod 750 html Needs to restart/relogin so the newly added group takes effect cd /var/wwwĪdd www-data as group member of html folder, and your user as owner, so we own it as well as a group member sudo chown -R $USER:www-data html ( CREDIT to markdwite in comments for the syntax of the revoke all privileges line)Īdd yourself/logged user to www-data group, so we can work with files created by www-data server sudo usermod -a -G www-data $USER Setfacl -R -d -m o::- /home/ers/directory ![]() # Revokes read, write and execute permissions for everyone else. Setfacl -R -d -m g::rwx /home/ers/directory # Gives group rwx permissions by default, recursively. # Revokes read and write permission for everyone else in existing folder and If you want to change folder's entire permission structure including the existing ones (you'll have to do an extra line and make it recursive with -R): setfacl -R -m g::rwx /Įxamples: # Gives group read,write,exec permissions for currently existing files and If you want to change the default folder location, access Internal Hard Drive -> System -> Library -> Core Services -> Archive Utility. To extract files from one directory to second directory while keeping the filename in the second directory i.e without the complete file path and file extension. If you look into the files you'll see the old contents. Create a folder in which you want to extract like this mkdir archive and pass folder name with -C while extracting, tar -xvf archive.zip -C archive. The next step changed the file contents and after that foo.tar was extracted. Using the default switch ( -d) and the modify switch ( -m) will only modify the default permissions but leave the existing ones intact: setfacl -d -m g::rwx / 1 Answer Sorted by: 18 You can try it by yourself: echo 1 > 1 echo 2 > 2 tar cf foo.tar 1 2 echo 3 > 1 echo 4 > 2 tar xf foo.tar cat 1 2 First two files ( 1 and 2) were created. This is an addition to Chris' answer, it's based on my experience on my Arch Linux rig. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |