I've read a nice article some time ago on how to make this more memorable. tar -czf(compress ze files) and tar -xzf(extract ze files). Great videos buddy and thank you for investing the time and effort in making these
I wanted to tell you that your method of explaining things is incredibly well done and give me confidence. I am currently looking to get into Fullstack Web Development and part of learning that is learning BASH and GIT. When I started coding again, I would get so frustrated on wrapping my head around concepts and problem solving. It nearly convinced me that I should just give up and stay with my Tier 1 support job. Then I started breaking my study sessions with one of your videos and taking notes on it. I don't know why, but you break down these concepts in a way that makes it seem so laid back and easy to understand. I get so much hope with watching your videos. I love watching your stuff, it makes me believe that moving into my new career won't be as rough as I initially feared it would be. Thank you again Dave.
Thanks, I really appreciate that. I've been following your notes as you post them and know for a fact that you are going to have this stuff down when the time for interviews etc. comes. Keep playing around with this stuff and do some practical projects (host a website, mess around with web development; whatever!). Don't wait too long to start interviewing. If you're not bombing the first few interviews, you waited too long to try. You got this!
Best thing about you mate, you give me something to hook all these facts onto. Ie, you talk about where it comes from. Tar = archiving and compression, they're not the same thing, and here's where it comes from, and some background about ftp...that is what people need in order to learn and retain knowledge. Most people aren't rainman, they can't just read an entire manual of dry technical data and then know how to use something. So thank you and bravo, this is what I need, and I think, what a lot of people need.
I'm grateful that you've covered a two-part tmux video session, on my previous job, I've just used tmux to avoid being disconnected during the execution of the ansible script, but you've taught us here the great power of tmux. Thank you so much, man.
The tarbomb bit got me wondering what would happen if the tarbomb had a file called file.txt and you already had a file in the directory you was extracting into with the same name. Turns out it overwrites it! :O
I love this -- you weren't sure how something would behave, so you tested it for yourself to find the answer. *Almost no one does this,* but it's one of the ways that you can guarantee that you'll actually retain that practical knowledge. Just wanted to thank you for doing that, and then posting the answer here for others to benefit from. You rock!
Yeah that scenario sucks... I was thinking it's easy to clean up with a script that unpacks the tarbomb safely, and deletes all the shrapnel, looping trough the file list, but that still wouldn't recover you your file... that's why you really need to have backup...
@@tutoriaLinux 20 years ago I did exactly the same thing with a win95 CD; when my dads windows 95 wouldn't boot... Fast forward 20 years Im studying linux&bsd bc networking was not enough. Learning by doing is realy the only way in IT i guess XD
Archiving and Compression on Linux - Basic tar Commands My Notes: What is the tar command? It stands for tap archive. (it is an archiving utility) - from the 1970s, like disco - What is archiving? The process of taking all the files & directories on a system and making a single file that contains them all. - creating one logical file out of all - What is compression? Using algorithms to look for repeating patterns inside files & save the space - can be then expanded back to those files on the other side - making files smaller (more simple a pattern, the more space you can save) - FTP is... NOT your friend - What is this command doing: tar -zcvf docs.tar.gz Documents/ Archiving and Compressing with tar 'f' will specify the filename for the directory (docs.tar.gz in this case) 'v' is verbose, means that we will get one line of output for each file we are compressing 'c' is for create, we are creating a new archive 'z' is for zipping (we are using the g zip program), used to compress archive as well as archiving it - What is this command doing: tar -zxf docs.tar.gz Unzips a tar directory HERE (in this location) 'z' shows that it is g zipped 'x' means to extract it 'f' defines the archive filename (in this case: docs.tar.gz) - What is a tar bomb? NOTHING IS CONTAINED A directory that is compressed as if you were sitting in the directory. It blows up in your face and scatters files/directories all over. Try to compress files from outside a directory (one directory above) - When should you create a tar bomb? Never ever ever ever ever ever ever Ever EVER create a tar bomb. (or when you don't like your new Junior Sysadmin) - When you extract a directory, what should you do before you extract it? Create a new directory and move inside that BEFORE EXTRACTION. (if you extract a tar bomb, it will be contained inside the folder) - Tell me if there is anything I missed. Please be safe and have a great day.
Great video. I recently started watching your playlist of beginner sysadmin tutorials, to improve my knowledge of basic Linux usage and so far I learnt some basic stuff I didn't know. Now I'm coming closer in knowledge to a friend of mine who works as junior sysadmin :D. So, for this video, another useful thing you could explain is how to view the content of an archive file without extracting it. I didn't know how to do it, so I tested and found this: tar -tf test.tar.gz (this will list all the files with their relative path) tar -tvf test.tar.gz (this will list all the files in the same way as running ls -l)
The tar bomb thing used to be an issue for me as well. I worked with wordpress and every plugin I extract is almost never a tar bomb or a zip bomb (this can happen with zip too) while every zip file I got from my clients was a tar bomb so I just kinda learned to make a container myself first then extract. Just a way to stay safe.
Except when his voice trails off (loses audible volume) at the conclusion of a sentence. Mr Dave does that three times in this video. Difficult for the older, hard-of-hearing person to understand. You'll be here.
Super great series Dave! Thank you. You mentioned ftp and have touched on various protocols in the series. can you recommend a video series on the relevant ones for a budding penetration tester that has the same vibe as yours?
Thank you for the tutorial. I was wondering how did you get the shell to ignore case on suggestion? I mean, you type "d", hit tab and it suggests both "decompression_chamber" and "Desktop". AFAIK, linux shell is case sensitive. I appreciate what you are doing here man.
I tried this, but it doesn't seem to work. I am running linux on my mac and a $ sign appears after my name. I think this requires a different installation type... any thoughts?
chinni chinni that was just a directory Dave created to demonstrate extracting the archive. He named it with his typical sense of humour. In other words, you can run tar commands anywhere, but it is often nice to stick a bunch of related tars in a directory somewhere before unpacking them.
Hi thanks for your help when i try to use Tar command i get this error tar: Removing leading `/' from member names tar: /Demo: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors i don,t know what is the wrong with that
i get the solution for this problem if you face this message it means you must change the owner of the file or folder and then try to use the Tar command and it will work without any problem
# Table of Contents: #
################
Compression + Archiving: 04:25
Decompression: 07:01
Don't do this: 09:34
Examples (Wordpress vs. Joomla): 12:19
Explanation of 'tar' options: 14:33
I've read a nice article some time ago on how to make this more memorable. tar -czf(compress ze files) and tar -xzf(extract ze files). Great videos buddy and thank you for investing the time and effort in making these
Compress ze files! but I'm le tired...
I wanted to tell you that your method of explaining things is incredibly well done and give me confidence.
I am currently looking to get into Fullstack Web Development and part of learning that is learning BASH and GIT.
When I started coding again, I would get so frustrated on wrapping my head around concepts and problem solving. It nearly convinced me that I should just give up and stay with my Tier 1 support job.
Then I started breaking my study sessions with one of your videos and taking notes on it. I don't know why, but you break down these concepts in a way that makes it seem so laid back and easy to understand. I get so much hope with watching your videos.
I love watching your stuff, it makes me believe that moving into my new career won't be as rough as I initially feared it would be.
Thank you again Dave.
Thanks, I really appreciate that. I've been following your notes as you post them and know for a fact that you are going to have this stuff down when the time for interviews etc. comes. Keep playing around with this stuff and do some practical projects (host a website, mess around with web development; whatever!). Don't wait too long to start interviewing. If you're not bombing the first few interviews, you waited too long to try. You got this!
you are really the best teacher for Unix
Best thing about you mate, you give me something to hook all these facts onto. Ie, you talk about where it comes from. Tar = archiving and compression, they're not the same thing, and here's where it comes from, and some background about ftp...that is what people need in order to learn and retain knowledge. Most people aren't rainman, they can't just read an entire manual of dry technical data and then know how to use something.
So thank you and bravo, this is what I need, and I think, what a lot of people need.
It's 2019 and your videos are inspiring next generation like me thanks bro very much love from india
I am not english native speaker but I can understand your lessons well. So thanks.
I'm grateful that you've covered a two-part tmux video session, on my previous job, I've just used tmux to avoid being disconnected during the execution of the ansible script, but you've taught us here the great power of tmux. Thank you so much, man.
Today precisely marks 6 years since this video was uploaded, and it's just as useful. THANK YOU SO MUCH!
Hah, thanks. I imagine it will last another 6 years!
@@tutoriaLinux hahaha! Most likely :D
I already know pretty much everything in your video's, but I still enjoy watching them. Keep up the good work!
The tarbomb bit got me wondering what would happen if the tarbomb had a file called file.txt and you already had a file in the directory you was extracting into with the same name. Turns out it overwrites it! :O
I love this -- you weren't sure how something would behave, so you tested it for yourself to find the answer. *Almost no one does this,* but it's one of the ways that you can guarantee that you'll actually retain that practical knowledge. Just wanted to thank you for doing that, and then posting the answer here for others to benefit from. You rock!
Ah thanks, right back at ya. FYI I bought your udemy course, keep up the awesome work!
Yeah that scenario sucks... I was thinking it's easy to clean up with a script that unpacks the tarbomb safely, and deletes all the shrapnel, looping trough the file list, but that still wouldn't recover you your file... that's why you really need to have backup...
@@tutoriaLinux 20 years ago I did exactly the same thing with a win95 CD; when my dads windows 95 wouldn't boot... Fast forward 20 years Im studying linux&bsd bc networking was not enough. Learning by doing is realy the only way in IT i guess XD
Archiving and Compression on Linux - Basic tar Commands
My Notes:
What is the tar command?
It stands for tap archive. (it is an archiving utility)
- from the 1970s, like disco
-
What is archiving?
The process of taking all the files & directories on a system and making a single file that contains them all.
- creating one logical file out of all
-
What is compression?
Using algorithms to look for repeating patterns inside files & save the space
- can be then expanded back to those files on the other side
- making files smaller
(more simple a pattern, the more space you can save)
-
FTP is...
NOT your friend
-
What is this command doing:
tar -zcvf docs.tar.gz Documents/
Archiving and Compressing with tar
'f' will specify the filename for the directory (docs.tar.gz in this case)
'v' is verbose, means that we will get one line of output for each file we are compressing
'c' is for create, we are creating a new archive
'z' is for zipping (we are using the g zip program), used to compress archive as well as archiving it
-
What is this command doing:
tar -zxf docs.tar.gz
Unzips a tar directory HERE (in this location)
'z' shows that it is g zipped
'x' means to extract it
'f' defines the archive filename (in this case: docs.tar.gz)
-
What is a tar bomb?
NOTHING IS CONTAINED
A directory that is compressed as if you were sitting in the directory. It blows up in your face and scatters files/directories all over.
Try to compress files from outside a directory (one directory above)
-
When should you create a tar bomb?
Never ever ever ever ever ever ever Ever EVER create a tar bomb.
(or when you don't like your new Junior Sysadmin)
-
When you extract a directory, what should you do before you extract it?
Create a new directory and move inside that BEFORE EXTRACTION.
(if you extract a tar bomb, it will be contained inside the folder)
-
Tell me if there is anything I missed. Please be safe and have a great day.
Thanks so much. It helped a lot.
Thanks to your explanation, I will finally be able to remember the tar commands without a brain CPU spike!!
I totally LOL'd at the "naughty_sites.txt" My list of adult content is slightly less conspicuous.
People like you are the reason I do this :-D.
it just got me REAL damn curious...
lmao
not_naughty_sites_TOP_SECRET_PLS_NO_OPEN.txt
Nice files ;-)
Great video. I recently started watching your playlist of beginner sysadmin tutorials, to improve my knowledge of basic Linux usage and so far I learnt some basic stuff I didn't know. Now I'm coming closer in knowledge to a friend of mine who works as junior sysadmin :D.
So, for this video, another useful thing you could explain is how to view the content of an archive file without extracting it. I didn't know how to do it, so I tested and found this:
tar -tf test.tar.gz (this will list all the files with their relative path)
tar -tvf test.tar.gz (this will list all the files in the same way as running ls -l)
The tar bomb thing used to be an issue for me as well. I worked with wordpress and every plugin I extract is almost never a tar bomb or a zip bomb (this can happen with zip too) while every zip file I got from my clients was a tar bomb so I just kinda learned to make a container myself first then extract. Just a way to stay safe.
Very informative and cool! Thank you!
Very helpful set of commands. I shall try this from now on. Thanks a ton.
Videos are only getting better!
Nice way to explain.. sound is neat and clean
Except when his voice trails off (loses audible volume) at the conclusion of a sentence. Mr Dave does that three times in this video. Difficult for the older, hard-of-hearing person to understand. You'll be here.
Pretty sure somewhere deep in that tar man page there must be a flag for "extract to xx folder" to avoid that tar bomb like situations.
Very helpful... thanks!!
Nice tarbomb tip! Thank you!
Super great series Dave! Thank you. You mentioned ftp and have touched on various protocols in the series. can you recommend a video series on the relevant ones for a budding penetration tester that has the same vibe as yours?
I haven't come across any, but I haven't been looking hard. Let me know if you find a channel like that!
thank you man.
Gotta love that cmatrix command 😂
Here's how I remember them: -c(create) -v(verbose) -j(compress to bzip2) -f(file name). So example: tar -cvjf foo.tar.bzip2 foo{1,2,3,4,5,6,7}.txt
Great video
thanks so much ur the best boss
Thank you for the video
What shell are you using?
+Andy Rhine ZSH (the Z shell), along with oh-my-zsh (check on github).
How do you get the colors in your terminal that you have? Is it just a custom setup or is it a theme that can be downloaded in Ubuntu?
Thank you for the tutorial.
I was wondering how did you get the shell to ignore case on suggestion? I mean, you type "d", hit tab and it suggests both "decompression_chamber" and "Desktop". AFAIK, linux shell is case sensitive.
I appreciate what you are doing here man.
@stillFLiP thanks man. Didn't know that.
is there any point to using gunzip and gzip if tar already exists
Thank youu so much, I subscribe at once :)
How do you get that pretty looking terminal?
+Soham Gumaste I use i3 as my window manager on all my work machines, along with ZSH (the Z shell). Search for oh-my-zsh to get started :-).
tutoriaLinux Thanks for the reply!
Another annoying thing is, when using full paths to create. Extracting those files will extract the full path...
You used to have to pipe the tar file through gzip to get compression.
how do you tree your directory.. I don't have that command
It's usually not installed by default. Just install tree and you should be good to go.
I tried this, but it doesn't seem to work. I am running linux on my mac and a $ sign appears after my name. I think this requires a different installation type... any thoughts?
@@mate123burYou have to run it through sudo.
lzma compression is great
Why do you need -z if you're extracting? is gzip extracting or tar?
I'm not able see decompression_chamber directory how can i extract
chinni chinni that was just a directory Dave created to demonstrate extracting the archive. He named it with his typical sense of humour.
In other words, you can run tar commands anywhere, but it is often nice to stick a bunch of related tars in a directory somewhere before unpacking them.
Hi thanks for your help when i try to use Tar command i get this error
tar: Removing leading `/' from member names
tar: /Demo: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
i don,t know what is the wrong with that
i get the solution for this problem if you face this message it means you must change the owner of the file or folder and then try to use the Tar command and it will work without any problem
Is it possible to view the content of a archive before decompressing it?
+limpep Sure: tar -ztvf file.tar.gz -- make sure to check out the manpage and Google around for what you want; tar can do a million things.
+tutoriaLinux Thanks tar -tf seems to do the trick.
I guess you can tell tar to extract to a specific folder explicitly?
I believe it's the -C option (create): linuxcommand.org/man_pages/tar1.html
You can leave out the z when unarchiving, as tar will auto decompress these days.
good video
Thanks a lot.
very well done my friend..can 'like' and 'subscribe' but I can't stand fakebook or twitter I'm afraid..
That makes two of us :-D
Thanks
tar -Jcvf docs.txz ~/Documents
tar -Jxvf docs.txz
yay, I'm like #1000
XKCD brought me here.
I love that joke :)
I'd be like `cat /home/dave/Documents/importantdocs/naughty_sites.txt` or hopefully `cat /home/dave/Documents/importantdocs/naughty_sites.txt | less`
How to have that matrix screensaver? hahahaha
me who only knows tar -xf
i can disarm the bomb
Pretty sure somewhere deep in that tar man page there must be a flag for "extract to xx folder" to avoid that tar bomb like situations.
Pretty sure somewhere deep in that tar man page there must be a flag for "extract to xx folder" to avoid that tar bomb like situations.
Pretty sure somewhere deep in that tar man page there must be a flag for "extract to xx folder" to avoid that tar bomb like situations.
Pretty sure somewhere deep in that tar man page there must be a flag for "extract to xx folder" to avoid that tar bomb like situations.
Pretty sure somewhere deep in that tar man page there must be a flag for "extract to xx folder" to avoid that tar bomb like situations.