Showing posts with label command line. Show all posts
Showing posts with label command line. Show all posts

How to create ZIP archive with relative paths

One question in SE site give me idea how to zip folder w/o including the current directory in the path. Here is the question:
I have a directory called folder that looks like this:
folder
      -> root_folder
                    -> some files
I want to zip this directory into zipped_dir..


And the answer I found was sample and effective:

Try to use this command (you will get the idea)
cd folder; zip -r ../zipped_dir.zip *
Maybe there is other way, but this is fastest and simplest for me :)

The lesson is that people must learn how to use relative directories :)
P.S. Here is the link to the Q/A in SE .

Fast guide to MySQL - part 2

Next part of subset of MySQL commands (for UNIX/Linux admins)

1. Display list of databases

SHOW DATABASES;

2. Display list of tables in current database

SHOW TABLES;


3. Display list of tables in noncurrent database

SHOW TABLES FROM database_name;

Fast guide to MySQL

This is just very little subset of command to help beginners with MySQL. Do not expect something extraordinary :)
All the command must be executed from mysql command prompt which you can reach with command:
mysql -u username -p password


1. Create database

CREATE DATABASE mybase;

2. Switch to use database

USE mybase;


3. Create user

CREATE USER myuser IDENTIFIED BY 'password';


4. Assign all right of user to database

GRANT ALL PRIVILEGES ON mybase.* TO 'myuser';

5. Flush privileges (to make them work at the moment)

FLUSH PRIVILEGES;

Be aware command are all caps, with small caps are parameters

Should I trust AI

 Should I trust AI? So far no, sorry.  I tested for the moment (May, 2025) most advanced model for programming and ask very simple question:...