Command Line
How To Create A Password Protected Zip Archive
Submitted by Sudheer on Thu, 03/27/2008 - 22:28.In my previous post we discussed how to create and extract ZIP archives. This post will teach you how to password protect your ZIP archives. While creating a ZIP archive, optionally, you can encrypt its contents using a password. Take advantage of this option to secure your ZIP archives. This tutorial is short and easy to learn.
How to password protect ZIP archives?
Let us assume we have two text files - abc.txt and xyz.txt in the present working directory.
[sudheer@localhost zip]$ ls
abc.txt xyz.txtLet us now create newarchive.zip and encrypt its contents with a password. The syntax is:
zip archivefilename file1, file2, ... -ewhere
- zip is the command
- archivefilename is the name of the ZIP archive to be created
- file, file2, ... are list of files to be included in the archive
- -e is the option that tells ZIP to encrypt the contents using a password typed in the terminal in response to a prompt
Creating and Extracting ZIP Archives With Zip and Unzip
Submitted by Sudheer on Sun, 03/23/2008 - 15:44.In this article you will learn how to create ZIP archives, list, test and extract them. After reading this article you will know how to manipulate ZIP archives on GNU/Linux systems. We already know that zip works well with tar from the Using TAR Command post. Let us discuss how to work with zip and unzip.
How to create a ZIP archive?
I believe learning by example is the easiest way. Let me walk you through an example straightaway. Let us assume we have two files - abc.txt and xyz.txt in the current working directory.
Using TAR Command
Submitted by Sudheer on Thu, 03/13/2008 - 12:06.So, you've got a tarball and want to know how to extract it, huh?
Some background info about tar: In the olden days, people primarily used tape devices to store and retrieve data. Tape drives still exist and folks use them to archive data. The name tar is derived from from tape archive. The name of the program that creates and extracts tar files also has the same name - tar. Tarball refers to the archive file. They usually have the extension filename.tar.gz.
Extracting tar files with extension .tar.gz: To extract a tar.gz file use the below command. Assuming you have a tarball by name archived-file.tar.gz:
tar -zxvf archived-file.tar.gzIn the above command the options have the following meaning.
- z - filter the archive through gzip. gzip aka GNU Zip is a program used to compress files. When you use -z option, gzip will be used in tandem with tar.
- x - extract files from an archive. Pretty self explanatory, huh?
- v - verbosely list files processed. The -v option prints information on the screen when the files are being extracted from the archive. If you do not use this option, tar still extracts files silently.
- f - use archive file. This option tells tar to extract from a file. The -f switch is required.
Two Commands To Move Your MySQL Database To A Different Computer
Submitted by Sudheer on Wed, 01/23/2008 - 15:11.Many popular web applications are written in PHP and use MySQL database. In this post I will describe, how you can move your database to a different computer. Almost all web applications store database and files system information in configuration files. You can actually move your web application to a different server without much hassle by editing few lines in these configuration files. I will write more about the configuration files of web applications in a different post. In this post I will walk you through the steps to move your MySQL database to a different server. The commands will help you move both data and schema.
What do you need to know before moving a database? On both the computers you will require the
- MySQL database name
- MySQL username that has access to the database
- Password for the username that has access to database
You can take a backup of your database in the form of SQL dump and restore it on another server quickly from the Shell. Later in the post we will discuss how you can import and export MySQL databases using a graphical tool.
Launch the terminal. If the server is accessible remotely using SSH you can execute these commands on the secure shell.
Command 1 to generate the backup
mysqldump -u mydatabaseuser -p mydatabase > backup.sqlInstalling, Removing And Updating Packages Using Yum
Submitted by Sudheer on Fri, 12/07/2007 - 17:37.If you want to quickly learn how to install, remove or update software packages on Fedora or CentOS, here is the short and sweet guide. To use yum you will require an Internet connection and the root password of your system.
Yum stands for Yellow dog Updater, Modified. Yum is currently maintained as part of Duke University's Linux@DUKE project. Using yum you can easily install, remove or update the software packages on your RPM based system. Fedora, CentOS and many other GNU/Linux distributions are based on RPM.
Yum is a command line utility. You will need to open the terminal and become root to use yum. On Fedora 8, click Applications on the gnone-panel, select System Tools and click on Terminal from the drop down menu. On the terminal, ie command line, type
su -
Type the root passwordIf you see the # symbol on the command line you are ready to go.
Updating software packages: The first thing I do after installing Fedora is update the system. Free and open source software projects are updated rapidly. To keep your system current you have to update packages installed on your computer from time to time. Fedora maintains many software repositories and their mirrors. Whenever software packages are developed or updated, they would be stored on these repositories. When you update your system using yum, you download the latest packages from these repositories and install them on your computer. To perform a full update of your system type the below command in the terminal:
yum updateYes, it's just a two word command. Isn't it easy to remember? After you type yum update and hit enter in the terminal, yum checks how many packages needs to be updated. Once it gathers the required information, it displays the name, architecture, version and size of the package. Yum also tells you the name of the repository in which the updates are available. It also gives you the transaction summary and the total download size. After promptly displaying all the above information, yum asks for your approval. If everything is ok, you type y and hit enter. Yum updates all the packages on your computer.
Recent comments
2 days 2 hours ago
2 days 5 hours ago
2 days 23 hours ago
3 days 21 hours ago
3 days 21 hours ago
5 days 22 hours ago
1 week 6 days ago
1 week 6 days ago
3 weeks 1 hour ago
5 weeks 1 day ago