All Series :-
Linux Part 1 [ First Series ]
Linux Part 2
Linux Part 3
Linux Part 4 [ Last Series ] - Current Page
Now There Goes the Last and 4th Part of Linux.
Earlier We have Discussed,
1). The Basics,
2). Using from Command Line.
3). Obtaining System Information.
4). Accessing System Remotely.
Now, In this Part 4, I will Guide you on How to Compress, Decompress, or Extract, User Management, How to manage Users account, and we will discuss about the most powerful software "RPM Package management Utility".
As we know many files can be reduced in file size by compressing their Contents. Moreoever, many files compression activities includes combining multiple files. Now, following commands are used in linux to handle the compression and decompression of files.
1). "tar -cvf file_name.tar filename/directory" - This command will command files will bundle a bunch of files together and creates an archive file and will get saved in same location from where the command was run from, before we proceed let Kro-Kite define tar, it is actually "tape archive". This tar command doesnot combine, this puts multiple files together into one name.So you must be surprised than what is the command for archive. we have "-cvf" parameter followed by tar, yes these defines the rest action.
So, now you have new archive with name blackbuntu.tar in blackbuntu directory.
2). "gzip file_name.tar" - Ok, here we will learn 1 new word (LZ77) this means Lempel-Ziv coding. So "gzip" command is used to compress files using the LZ77 method. This command doesn't create any new files, this replaces the old files, in most cases the files are already "tar'd"{See above to this point}. Even we can see the command file_name has ".tar" extension, now what to do and what is output, see below
will give you blackbuntu.tar.gz and blackbuntu.tgz, and your original file blackbuntu.tar will be blackbuntu.tar.gz or blackbuntu.tgz
3). "bzip2 file_name" - (bzip means big zip), This command will compress a file, identified by file_name using the "Burrows-Wheeler block sorting" text compression algorithm and "huffman coding".
For more detail about Google Search Results for: Burrows-Wheeler transform & Google Search Results for: Huffman Coding algorithm Click the link of google, Kro-Kite is sure you will come to know more about this, after checking the link as the first link is one and Kro-Kite favorite page "wiki". Example
This method is better than gunzip method or method described in point 2, and extension is (.bz2)
1). "tar -zxvf file_name.tar.gz" - This Command will decompress the files that have been tar'd and zipped using "tar" and "gzip" commands. as told earlier "tar" command used in command doesnt really compress or decompress, even here, "-zxvf" parameter tells, the program to compress or decompress:-
This command will extract the file to root directory (/).
2). "gunzip file_name.tar.gz" - This commands decompress those files which was compressed with gzip command.
3). "bunzip2 file_name.bz2" - This commands decompress those files that have been compressed with "bzip2" command
4). unzip file_name.zip - We all must be knowing ".zip" extension, So, this command decompress ".zip" files which have been compressed with "PKZIP" command for the DOS or Microsoft Disk Operating system.
1). adduser username - Command for creating user on localhost. "useradd" command is equivalent as "adduser" command.
2). "groupadd groupname" - This will add group with groupname.
3). "passwd username password" - This will change the password of username with "password" as password.
4). "chmod permission file_name" - This command is used to "chmod" change the permission for file.Files permission are set using three modes:-
and there are three usergroups- "Root {Owner}", Group, Other{Public}.
So permission is given in forllowing formats:-
Example:-
5). "chown owner_name file_name" - This command changes the owner of file (filename). This is to be done after copyig files from root to different locations.
6). "chgrp group_name file_name" - This commands changes or adss the group of specified file (filename).Even this command has to be run after copying file from another system or location.
7). "su username" - "su" means substitute user, so thi command allows the end user to login as another user such as root.For this end user has to be type the specified password for the username which he wants to login.
RPM full form= Red Hat's Package Manager, and this is a powerful software manager which can install, remove, query and verify the software on a system. To execute the RPM application you need to be root user. Following are the common commands associated with RPM package managemnt utility.
1). "rpm -ivh filename.rpm" - This commands install RPM package or packages and then provide a detailed output on what was accomplished. The -ivh parameters identify that package should be :-
2). "rpm -qpi filename.rpm" - This commands read the content of the RPM file without installing the actual RPM and provides information about package. The "-qpi" parameters provide following functionality:-
ok so you might have noticed/observed we have "i" command in both the (1) & (2) function, and both of them has different functionality. So the theory in this is, whenever "i" comes with dashes infront like "-i" than this defines the function as install property, and when it comes @ 2nd or 3rd place or non-1st place than "i" has the property of providing information.
3). "rpm -qpl filename.rpm" - As the above command was giving the information, similarily this commands lists the file that package contains, so all the parameter meanings are same except we have used here "l" (l=L lower case) which means list all package instead of earlier used "i" which function was to give information of files.
4). "rpm -gf filename" - This command displays the name of the ".rpm" package to which the file "filename" belongs. This is useful command if the origianl RPM package is unknwon and there is no need to re-install the application.
5). "rpm -e packagename" - This command uninstalls the RPM package name "packagename". The packagename is same name as the origianal RPM package installed but without the dash and version number or ".rpm" extension.
All the above commands under RPM package manager utility were basic commands to start with. More will be put on users demand.
Linux Part 1 [ First Series ]
Linux Part 2
Linux Part 3
Linux Part 4 [ Last Series ] - Current Page
Now There Goes the Last and 4th Part of Linux.
Earlier We have Discussed,
1). The Basics,
2). Using from Command Line.
3). Obtaining System Information.
4). Accessing System Remotely.
Now, In this Part 4, I will Guide you on How to Compress, Decompress, or Extract, User Management, How to manage Users account, and we will discuss about the most powerful software "RPM Package management Utility".
File Compression & Decompression
As we know many files can be reduced in file size by compressing their Contents. Moreoever, many files compression activities includes combining multiple files. Now, following commands are used in linux to handle the compression and decompression of files.
Compression
1). "tar -cvf file_name.tar filename/directory" - This command will command files will bundle a bunch of files together and creates an archive file and will get saved in same location from where the command was run from, before we proceed let Kro-Kite define tar, it is actually "tape archive". This tar command doesnot combine, this puts multiple files together into one name.So you must be surprised than what is the command for archive. we have "-cvf" parameter followed by tar, yes these defines the rest action.
- c -> "Create" a new archive.
- v -> display a "verbose" output to the end user.
- f -> for the given "filename".
Code:
tar -cvf blackbuntu.tar ~/My_Documents/blackbuntu/
So, now you have new archive with name blackbuntu.tar in blackbuntu directory.
2). "gzip file_name.tar" - Ok, here we will learn 1 new word (LZ77) this means Lempel-Ziv coding. So "gzip" command is used to compress files using the LZ77 method. This command doesn't create any new files, this replaces the old files, in most cases the files are already "tar'd"{See above to this point}. Even we can see the command file_name has ".tar" extension, now what to do and what is output, see below
Code:
gzip blackbuntu.tar
3). "bzip2 file_name" - (bzip means big zip), This command will compress a file, identified by file_name using the "Burrows-Wheeler block sorting" text compression algorithm and "huffman coding".
For more detail about Google Search Results for: Burrows-Wheeler transform & Google Search Results for: Huffman Coding algorithm Click the link of google, Kro-Kite is sure you will come to know more about this, after checking the link as the first link is one and Kro-Kite favorite page "wiki". Example
Code:
bzip2 blackbuntu.txt
bzip2 blackbuntu.txt Kro-Kite.txt c1ph3r.txt x-code.txt nocdem.txt noes1s.txt > blackbuntu.bz2
This method is better than gunzip method or method described in point 2, and extension is (.bz2)
Decompression
1). "tar -zxvf file_name.tar.gz" - This Command will decompress the files that have been tar'd and zipped using "tar" and "gzip" commands. as told earlier "tar" command used in command doesnt really compress or decompress, even here, "-zxvf" parameter tells, the program to compress or decompress:-
- z - compress or decompress "automatically".
- x - "extract" the file.
- v - display the "verbose" output to the end user.
- f - with your defined "filename".
Code:
~/tar -zxvf blackbuntu.tar.gz
2). "gunzip file_name.tar.gz" - This commands decompress those files which was compressed with gzip command.
Code:
gunzip blackbuntu.tar.gz
3). "bunzip2 file_name.bz2" - This commands decompress those files that have been compressed with "bzip2" command
Code:
bunzip2 blackbuntu.bz2
4). unzip file_name.zip - We all must be knowing ".zip" extension, So, this command decompress ".zip" files which have been compressed with "PKZIP" command for the DOS or Microsoft Disk Operating system.
Code:
unzip blackbuntu.zip
User Management
1). adduser username - Command for creating user on localhost. "useradd" command is equivalent as "adduser" command.
Code:
adduser Kro-Kite
2). "groupadd groupname" - This will add group with groupname.
Code:
groupadd verified_members
3). "passwd username password" - This will change the password of username with "password" as password.
Code:
passwd Kro-Kite blackbuntu
4). "chmod permission file_name" - This command is used to "chmod" change the permission for file.Files permission are set using three modes:-
- r - read only permission.
- w - write only permission.
- x - execute permission.
and there are three usergroups- "Root {Owner}", Group, Other{Public}.
So permission is given in forllowing formats:-
Code:
1). rwxrwxrwx - this means permission give to all user to read, write and execute, which for security purpose is not recommended to set. This is also defined in "777" mod.
2). rwrx-xr-xr - this means owner can read,write and execute, group & other can read and execute only, this is recommended for folders/directories.
3). rw-r-r - this means owner can write and read, and groups can read this is recommended for files.
Code:
chmod 755 /home/blackbuntu/www/
5). "chown owner_name file_name" - This command changes the owner of file (filename). This is to be done after copyig files from root to different locations.
Code:
chown Kro-Kite blackbuntu.php
6). "chgrp group_name file_name" - This commands changes or adss the group of specified file (filename).Even this command has to be run after copying file from another system or location.
Code:
chgrp registered blackbuntu.php
7). "su username" - "su" means substitute user, so thi command allows the end user to login as another user such as root.For this end user has to be type the specified password for the username which he wants to login.
Code:
sudo -su Kro-Kite/root // there should be root for you or the one you have in your system.
RPM Package Management Utility
RPM full form= Red Hat's Package Manager, and this is a powerful software manager which can install, remove, query and verify the software on a system. To execute the RPM application you need to be root user. Following are the common commands associated with RPM package managemnt utility.
1). "rpm -ivh filename.rpm" - This commands install RPM package or packages and then provide a detailed output on what was accomplished. The -ivh parameters identify that package should be :-
- i -> installed.
- v -> provide verbose output.
- h -> and display hashes.
2). "rpm -qpi filename.rpm" - This commands read the content of the RPM file without installing the actual RPM and provides information about package. The "-qpi" parameters provide following functionality:-
- q - query to perform.
- p - yet to be installed package or without preinstalling package.
- i - display the information that the package contains.
ok so you might have noticed/observed we have "i" command in both the (1) & (2) function, and both of them has different functionality. So the theory in this is, whenever "i" comes with dashes infront like "-i" than this defines the function as install property, and when it comes @ 2nd or 3rd place or non-1st place than "i" has the property of providing information.
3). "rpm -qpl filename.rpm" - As the above command was giving the information, similarily this commands lists the file that package contains, so all the parameter meanings are same except we have used here "l" (l=L lower case) which means list all package instead of earlier used "i" which function was to give information of files.
4). "rpm -gf filename" - This command displays the name of the ".rpm" package to which the file "filename" belongs. This is useful command if the origianl RPM package is unknwon and there is no need to re-install the application.
5). "rpm -e packagename" - This command uninstalls the RPM package name "packagename". The packagename is same name as the origianal RPM package installed but without the dash and version number or ".rpm" extension.
All the above commands under RPM package manager utility were basic commands to start with. More will be put on users demand.
Copyright © Kro-Kite [ Read Common Creative License at Footer ]