What's new

Welcome to Ruzgar.com

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask questions and get answers from our community

Answer

Answer questions and become an expert on your topic

Contact us

Contact the site administrator directly.

Groups

Just like Facebook join them and enjoy.

Centos Lesson 5 Links, File Compression and Backup

ruzgar

Administrator
Staff member
Joined
Oct 3, 2021
Messages
37
Reaction score
0
Points
6
Links:

There are 2 types of links in Linux. Hard Link (ln) --> When the link is given, it is as if the file was copied. The link still works when the source is deleted. It takes up too much space. Soft Link (ls)--> It is the process of creating a path that we know.
  • ln /home/ruzgar.txt /usr/ruzgar_link.txt : We have put the link of the ruzgar.txt file in the /home folder in the usr folder. Even if one is deleted, the other works.
  • ls /home/ruzgar.txt /usr/ruzgar_link.txt : We have put the link of the ruzgar.txt file in the /home folder in the usr folder. Even if one is deleted, the other will not work.
  • ln -s /ruzga/nokta/com/harika/bir/site/dir ruzgarlink : With this command, we gave a name to the complex folder subfolder system. If we type cd /ruzgarlink, we find ourselves in the /dir folder.
File Compression and Backup:

Tar:

tar stands for Tape Archive. After tar is consecutive words: Tar does not compress files. Combines.
  • -c: means Create
  • -f: File refers to the file.
  • -x: Extract means extract.
  • -A: adds tar files to archive.
  • -t: lists archive contents.
  • -d: compares the contents of the archives.
  • -v: It is a general command. Shows transactions line by line
Examples:
  • tar -csf ruzgar.tar com : Compresses the files in the com folder as ruzgar.tar.
  • tar -xvf ruzgar.tar : Opens the ruzgar.tar archive.
  • tar -rf ruzgar.tar /user/deneme.jpg : Adds the image test.jpg to the ruzgar.tar archive file.
  • tar cvzf ruzgar.tar.gz com : Compresses the com folder as ruzgar.tar.gz.
  • tar -xvf ruzgar.tar.gz: Unpacks archive
  • tar -tvf ruzgar.tar : Shows the contents of the archive without unpacking it.
gzip:

Unlike gzip tar it will compress files by 40%.
  • gzip ruzgar.txt : It will extract a compressed file as ruzgar.txt.gz.
  • gunzip ruzgar.txt.gz : will extract the file from the zip.
Compress:

Same as Gzip. The file extension is saved as .Z.
  • compress ruzgar.txt : It will extract a compressed file as ruzgar.txt.Z.
  • uncompress ruzgar.txt.Z : will unzip the file.
 
shape1
shape2
shape3
shape4
shape5
shape6
Top