January 30th, 2021
Hello everyone, today I'll briefly explain some more basic Unix commands, it'll be a fairly short one and with much lesser details. So if you are ready let's start with the first one.
The first one we'll talk about today is tar, with tar you can archive and unarchive directories.
Here we create a directory called filetozip(maybe I should've named it filetotar but you got the point), and then we compress and uncompress that file via using tar, since compress is also a command in Unix you can say tar and untar instead.
Gzip is being used for similar reasons but instead it work on files for compressing purposes, the use of it also fairly simple.
As you can see here we create a file called "filetogzipped" first we gzip and gunzip it just by giving the target as the first parameter.
It's quite simple, prints the name of the user who ran the command.
Unlike whoami, who prints the all the currently logged in users, for example below here I have 2 terminals opened with 2 users and I get both of them with the terminals they opened.
If I close one of them instead I'll see something like that one.
Sometimes when you connect to a remote server over ssh knowing the current system date can be so important to see that you can simply run that command and the system date is at your service.
Sometimes you may want to see your commands history for obvious reasons, in such a case all you need to do is to run "history". You'll end up with something like below you can go up and down via arrow keys and you can escape via pressing the key "q".
The fortune is a really fun command and a pretty old one, it can give random funny texts to you as an output, if you want you can pipe it to some other command to save, but seriously, why would you? :)
Alright everyone, that's it for today, since I started to give basic commands in multiple section I'll write 1 more after that and I'll finish it, yet now it feels like they all can be better together so I'll merge them all together after I finish the series.
I hope to see you in the next one, take care :)