mirror of
https://github.com/LCTT/TranslateProject.git
synced 2025-02-03 23:40:14 +08:00
Merge branch 'master' of https://github.com/LCTT/TranslateProject
This commit is contained in:
commit
4bef2af5a2
@ -1,31 +1,33 @@
|
||||
如何在Debian和Ubuntu下重新打包Deb文件
|
||||
================================================================================
|
||||
|
||||
**以下教程将会教导Ubuntu、Linux Mint和Debian GUN/Linux用户,如何在它们基于Debian的Linux操作系统上轻松的解压和重新打包.deb文件。**
|
||||
**以下教程将会为Ubuntu、Linux Mint和Debian GUN/Linux用户讲述,如何在它们基于Debian的Linux操作系统上轻松的解压和重新打包.deb文件。**
|
||||
|
||||
![](http://i1-news.softpedia-static.com/images/news2/How-to-Repack-Deb-Files-on-Debian-and-Ubuntu-404930-2.jpg)
|
||||
|
||||
有时候你在生活中会碰到这样的问题,你想要修改.deb文件的部分内容,然后重新打包。但是这也只有你真正进入到计算机世界以及黑客世界当中才能完成。
|
||||
有时候你在生活中会碰到这样的问题,你想要修改.deb文件的部分内容,然后重新打包。不过只有你真正深入了解计算机才能完成这样的黑客技巧。
|
||||
|
||||
下面的例子是刚发生在我身上的真实经历。一位Linux开发者为一个软件构建了一个Debian包(.deb),我也成功地将它安装在我的装载Ubuntu的电脑上。
|
||||
下面的例子是刚发生在我身上的真实经历。一位Linux开发者为一个软件构建了一个Debian包(.deb),我也成功地将它安装在我的装载Ubuntu的电脑上。
|
||||
|
||||
当我试图从一个Git库中检索一些文件时,它总是卡顿,很显然,该软件并没有正常工作。我知道安装的文件在哪里(/opt目录),所以,我搜查了代码并适当地将部分问题修复。之后,当程序试图检索需要的包时不再卡顿。
|
||||
|
||||
所以,长话短说,我要将.deb文件解包,替换上我的补丁文件,然后再重新打包回来。这样我可以其它电脑上安装,或者将有效的包文件给我的朋友。我要怎么做呢?
|
||||
所以,长话短说,我要将.deb文件解包,替换上我的补丁文件,然后再重新打包回来。这样我可以其它电脑上安装,或者将修正的包文件发给我的朋友。我要怎么做呢?
|
||||
|
||||
在网络上搜索问题的答案,我发现一个名叫[ailoo.net][1]的小型博客,它给出类似这样解释:
|
||||
|
||||
mkdir -p extract/DEBIAN
|
||||
|
||||
dpkg-deb -x package.deb extract/
|
||||
|
||||
dpkg-deb -e package.deb extract/DEBIAN [...do something, e.g. edit the control file...]
|
||||
|
||||
mkdir build
|
||||
|
||||
dpkg-deb -b extract/ build/
|
||||
|
||||
这五条命令将奇迹般地完成工作。让我为你解释一下:第一条命令创建了一个名为“extract”文件夹和一个名为“DEBIAN”的子文件夹;第二条命令会从你的.deb包提取程序文件到“extract”文件夹;第三条命令会解压.deb包的控制文件到“DEBIAN”子文件夹,在那里你就可以 修改/补丁 你想要的文件;第四条命令建立一个名为“build”的文件夹;而第五条命令会将修改后的文件重新构建到一个新的.deb包中,并在 “build” 文件夹中生成。
|
||||
这五条命令将奇迹般地完成工作。让我为你解释一下:
|
||||
|
||||
- 第一条命令创建了一个名为“extract”文件夹和一个名为“DEBIAN”的子文件夹;
|
||||
- 第二条命令会从你的.deb包提取一些文件到“extract”文件夹;
|
||||
- 第三条命令会解压.deb包的内容到“DEBIAN”子文件夹,在那里你就可以修改/补丁你想要的文件;
|
||||
- 第四条命令建立一个名为“build”的文件夹;
|
||||
- 而第五条命令会将修改后的文件重新构建到一个新的.deb包中,并在 “build” 文件夹中生成。
|
||||
|
||||
这就是本次教程!牢牢地记住上面的命令吧,在你执行第三条命令后,可以通过你的默认文件管理器,用一个图形化的文本编辑器可视化地修改文件。如果你在学习本教程时遇到问题,不要犹豫,在下面给我们写下评论。
|
||||
|
@ -4,7 +4,7 @@ Linux系统 whoami 命令 – 知晓当前登录用户
|
||||
|
||||
### 怎么样运行 whoami ###
|
||||
|
||||
运行这个命令,你只需要输入 whoami 。下面的例子中我们使用的是 chs shell 终端。
|
||||
运行这个命令,你只需要输入 whoami 。下面的例子中我们使用的是 csh shell 终端。
|
||||
|
||||
% whoami
|
||||
|
@ -1,105 +0,0 @@
|
||||
Linux id Command – Print user ID and group ID information
|
||||
================================================================================
|
||||
To log in into a computer, we need a username. Username is an identity to recognized by a computer. Based on it, computer will apply a set of rules to a someone that log in with that username. On Linux system we can use **id** command.
|
||||
|
||||
### What is id command ###
|
||||
|
||||
**id** command is command which can print real and effective User ID (UID) and Group ID (GID). An UID is a single identity for a user. While Group ID (GID) can consist more than one UID.
|
||||
|
||||
### How to use it ###
|
||||
|
||||
By default, **id** command is installed on most of Linux system. To use it, just type id on your console. Typing id without no options will result as below. The result will use the active user.
|
||||
|
||||
$ id
|
||||
|
||||
![Default id output](http://linoxide.com/wp-content/uploads/2013/12/id_default.png)
|
||||
|
||||
#### Here’s how to read the output : ####
|
||||
|
||||
- User **pungki** has **UID** number = **1000**, **GID** number = **1000**
|
||||
- User **pungki is a member** of the following groups :
|
||||
|
||||
**pungki** with GID = **1000**
|
||||
**adm** with GID = **4**
|
||||
**cdrom** with GID = **24**
|
||||
**sudo** with GID = **27**
|
||||
**dip** with GID = **30**
|
||||
**plugdev** with GID = **46**
|
||||
**lpadmin** with GID = **108**
|
||||
**sambashare** with GID = **124**
|
||||
|
||||
### Using id with options ###
|
||||
|
||||
There are some options that can applied to id command. Here’s some options that may useful on day-to-day basis.
|
||||
|
||||
#### Print user name, UID an all the group to which the user belongs ####
|
||||
|
||||
To do this, we can use **-a** option
|
||||
|
||||
$ id -a
|
||||
|
||||
![-a option](http://linoxide.com/wp-content/uploads/2013/12/id_a.png)
|
||||
|
||||
#### Output all different group IDs (effective, real and supplementary) ####
|
||||
|
||||
We can use **-G** option to do fulfill this.
|
||||
|
||||
$ id -G
|
||||
|
||||
![-G option](http://linoxide.com/wp-content/uploads/2013/12/id_G.png)
|
||||
|
||||
The result will only show the GID numbers. You can compare it with **/etc/group** file. Here’s a sample of **/etc/grou**p content :
|
||||
|
||||
root:x:0:
|
||||
daemon:x:1:
|
||||
bin:x:2:
|
||||
sys:x:3:
|
||||
adm:x:4:pungki
|
||||
fax:x:21:
|
||||
voice:x:22:
|
||||
cdrom:x:24:pungki
|
||||
floppy:x:25:
|
||||
tape:x:26:
|
||||
sudo:x:27:pungki
|
||||
audio:x:29:pulse
|
||||
dip:x:30:pungki
|
||||
www-data:x:33:
|
||||
backup:x:34:
|
||||
operator:x:37:
|
||||
sasl:x:45:
|
||||
plugdev:x:46:pungki
|
||||
ssl-cert:x:107:
|
||||
lpadmin:x:108:pungki
|
||||
saned:x:123:
|
||||
sambashare:x:124:pungki
|
||||
winbindd_priv:x:125:
|
||||
|
||||
#### Output only the effective group ID ####
|
||||
|
||||
Use **-g** option to output only the effective group ID
|
||||
|
||||
$ id -g
|
||||
|
||||
![-g option](http://linoxide.com/wp-content/uploads/2013/12/id_g1.png)
|
||||
|
||||
#### Print the specific user information ####
|
||||
|
||||
We can output a specific user information related UID and GID. Just put the user name after id command.
|
||||
|
||||
$ id leni
|
||||
|
||||
![leni user](http://linoxide.com/wp-content/uploads/2013/12/id_leni.png)
|
||||
|
||||
Above command will print UID and GID of user named **leni**.
|
||||
|
||||
### Conclusion ###
|
||||
|
||||
This id command is useful for us when we want to know about UID and GID of a user. Some applications may need UID / GID to be run. id make us easier to find UID and GID of a user without seeing and searching it inside /etc/group file. As usual you can go to id manual page by typing **man id** from your console to explore more detail.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/linux-id-command/
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -1,69 +0,0 @@
|
||||
翻译中 by tomatoKiller
|
||||
|
||||
The Genius Of Linux Is Community, Not Technology
|
||||
================================================================================
|
||||
> Linux never fulfilled its original promise as an old-school desktop operating system. But its everywhere in 2013, driven by a vibrant community.
|
||||
|
||||
2013 was the year of Linux in everything. Linux Foundation executive director Jim Zemlin declared that Linux's ubiquity has reached every corner of computing. "From smartphones, tablets, consumer appliances and cars, to the open cloud and high-performance computers, to gaming platforms and more, Linux was, and is, literally everywhere," [Zemlin said][1].
|
||||
|
||||
How did Linux spread to every corner of the world of technology? After all, Linux never truly realized its initial promise as an old-school desktop operating system destined to take down Microsoft and Windows. Kernels and code are only part of the story. The omnipresence of Linux comes down to it's far-ranging ability to inspire and unite a community, rather than to superior technology.
|
||||
|
||||
### Good Enough And Then Some ###
|
||||
|
||||
That being said, we are not suggesting that Linux would have been nearly as successful if the technology were poor. As Monica Kumar, senior director of Linux, MySQL, Virtualization and Open Source Product Marketing at Oracle, [tells it][2], "without superior tech, the superior community would not have rallied around Linux." This is [one of the key components][3] of any successful open-source project: great initial code.
|
||||
|
||||
But it's not enough.
|
||||
|
||||
When it launched, Linux was a cheap, 'good enough' alternative to proprietary UNIX. It wasn't, however, better. Indeed, more than 10 years after Linux was first developed [InfoWorld could credibly claim][4] that UNIX variant "Solaris is the technologically superior OS" compared to Linux. UNIX, after all, is targeted at a relatively narrow class of applications and hardware, allowing its vendors to heavily optimize it for suggested workloads.
|
||||
|
||||
As [IBM explains][5], Linux is the exact opposite:
|
||||
|
||||
> The development of GNU/Linux...is more diverse [than that of UNIX]. Developers come from many different backgrounds, and therefore have different experiences and opinions. There has not been as strict of a standard set of tools, environments, and functionality within the Linux community....This lack of standards results in noticeable inconsistencies within Linux.
|
||||
|
||||
It also, ironically, results in Linux's greatest strength: the ability to be all things to all users.
|
||||
|
||||
### Why The Community Loves Linux ###
|
||||
|
||||
But why Linux? Given that Linux was barely good enough for most tasks when it launched, what motivated a community to form? Brent Fox, director of OEM Programs at Canonical, the Ubuntu Linux vendor, argues that the rewards of a common platform justified the risk it would fail:
|
||||
|
||||
> [@mjasay][6] The tech itself was immature for a long time. It was the potential to disrupt the established OS players. That draws a large crowd.
|
||||
> — Brent Fox (@brentfox) [December 19, 2013][7]
|
||||
|
||||
This is mostly true, but it doesn't fully match history. After all, one of the earliest proponents of Linux was a company that had a sizable UNIX business to protect: IBM. But IBM needed Linux to unify its disparate hardware lines, and saw the potential to build an even bigger hardware and services business on Linux, even at the expense of some UNIX revenue.
|
||||
|
||||
Today, Linux sits at the heart of many billion-dollar businesses. What started as Linus Torvalds' hack has become the focal point for some of the world's biggest companies and best developers, as the "[Who Writes Linux?" report reflects][8].
|
||||
|
||||
### Strength Through Diversity ... And Linus ###
|
||||
|
||||
The ability to corral conflicting, sometimes competitive interests under one banner that has made Linux so successful. It has motivated wildly disparate companies and individual developers to shape Linux to meet their needs. As Apache Software Foundation president [Jim Jagielski told me][9], "Building a kernel is easy, compared to building a healthy and viable community. Linux succeeds because the community does."
|
||||
|
||||
The list of the top Linux development sponsors points to those seeking and finding Linux success:
|
||||
|
||||
![](http://readwrite.com/files/Screen%20Shot%202013-12-19%20at%208.58.36%20AM.png)
|
||||
|
||||
ndergirding this diversity is [Linus Torvalds' phenomenal leadership][10]. With everyone jockeying to make Linux their own, Torvalds has managed to make Linux a meritocracy backed by his authority to say "No." It has worked very well, but there has been enough give to let companies contribute drivers or other technology that makes Linux a strong fit for their customers.
|
||||
|
||||
As fantastic as Linux technology has become, however, it's arguably not Linux's greatest strength. As Zemlin told me in an email:
|
||||
|
||||
> I don't get asked as much about Linux these days even though it is used everywhere. Companies want to know how to maximize it but also how to apply its principles to other things. This is what I'm increasing asked about and talking about: how the community works.
|
||||
|
||||
Great technology is written all the time. Most of it fails miserably to find an audience. The genius of Linus Torvalds, and Linux development that he shaped, is the community development model he largely pioneered and perfected.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://readwrite.com/2013/12/19/the-genius-of-linux-is-community-not-technology#feed=/hack
|
||||
|
||||
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.linuxfoundation.org/news-media/blogs/browse/2013/12/2013-year-linux-the%E2%80%A6everything
|
||||
[2]:https://twitter.com/mbkumar/status/413689410308173825
|
||||
[3]:http://asay.blogspot.com/2005/09/so-you-want-to-build-open-source.html
|
||||
[4]:http://www.infoworld.com/t/platforms/seven-ways-solaris-can-beat-linux-978
|
||||
[5]:http://www.ibm.com/developerworks/aix/library/au-unix-difflinux.html
|
||||
[6]:https://twitter.com/mjasay
|
||||
[7]:https://twitter.com/brentfox/statuses/413696557620293632
|
||||
[8]:http://www.linuxfoundation.org/publications/linux-foundation/who-writes-linux-2013
|
||||
[9]:https://twitter.com/jimjag/status/413704747791970304
|
||||
[10]:http://readwrite.com/2013/08/27/linux-turns-22-but-open-source-is-eternal
|
@ -1,13 +1,14 @@
|
||||
[bazz2 咩哈哈哈哈哈]
|
||||
15 Basic MySQL Interview Questions for Database Administrators
|
||||
15个 MySQL 基础面试题,DBA 准备好了吗?
|
||||
================================================================================
|
||||
Prior to This Article, three articles has already been published in ‘[Linux Interview][1]‘ Section and all of them were highly appreciated by our notable readers, however we were receiving feedback to make this interactive learning process, section-wise. From idea to action, we are providing you **15 MySQL Interview Questions**.
|
||||
|
||||
此前我们已经有发表过[Linux 面试基础问答]共3篇文章,获得读者的好评,同时我们得到反馈,有些读者希望这种交互式学习方法能够做得更加灵活。心动不如行动,我们这就为您奉上**15道 MySQL 面试题**
|
||||
|
||||
![](http://www.tecmint.com/wp-content/uploads/2013/12/Mysql-Interview-Questions.png)
|
||||
|
||||
### 1. How would you check if MySql service is running or not? ###
|
||||
|
||||
> **Answer** : Issue the command “**service mysql status**” in ‘Debian’ and “**service mysqld status**” in RedHat. Check the output, and all done.
|
||||
### 问题1:你如何确定 MySQL 是否处于运行状态? ###
|
||||
|
||||
> **答案**: Debian 上运行命令 **service mysql status;**;RedHat 上运行命令 **service mysqld status;**。然后看看输出即可。
|
||||
|
||||
root@localhost:/home/avi# service mysql status
|
||||
|
||||
@ -26,9 +27,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
|
||||
Threads: 1 Questions: 112138 Slow queries: 1 Opens: 1485 Flush tables: 1 Open tables: 64 Queries per second avg: 22.567.
|
||||
|
||||
### 2. If the service is running/stop how would you stop/start the service? ###
|
||||
### 问题2:如何关闭或开启 MySQL 服务? ###
|
||||
|
||||
> **Answer** : To start MySql service use command as **service mysqld start** and to stop use **service mysqld stop**.
|
||||
> **答案**:运行命令 **service mysqld start;** 开启服务;运行命令 **service mysqld stop** 停止服务。
|
||||
|
||||
root@localhost:/home/avi# service mysql stop
|
||||
|
||||
@ -40,9 +41,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
|
||||
Checking for corrupt, not cleanly closed and upgrade needing tables..
|
||||
|
||||
### 3. How will you login to MySQL from Linux Shell? ###
|
||||
### 问题3:如何通过 Shell 登入 MySQL? ###
|
||||
|
||||
> **Answer** : To connect or login to MySQL service, use command: **mysql -u root -p**.
|
||||
> **答案**:运行命令 **mysql -u root -p;**
|
||||
|
||||
root@localhost:/home/avi# mysql -u root -p
|
||||
Enter password:
|
||||
@ -60,9 +61,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
|
||||
mysql>
|
||||
|
||||
### 4. How will you obtain list of all the databases? ###
|
||||
### 问题4:如何列出所有数据库? ###
|
||||
|
||||
> **Answer** : To list all currently running databases run the command on mysql shell as: **show databases**;
|
||||
> **答案**:运行命令 **show databases;**
|
||||
|
||||
mysql> show databases;
|
||||
+--------------------+
|
||||
@ -81,9 +82,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+--------------------+
|
||||
10 rows in set (0.14 sec)
|
||||
|
||||
### 5. How will you switch to a database, and start working on that? ###
|
||||
### 问题5: 如何切换到某个数据库并在上面工作? ###
|
||||
|
||||
> **Answer** : To use or switch to a specific database run the command on mysql shell as: **use database_name**;
|
||||
> **答案**:运行命令 **use database_name;** 进入名为 database_name 的数据库。
|
||||
|
||||
mysql> use cloud;
|
||||
Reading table information for completion of table and column names
|
||||
@ -92,9 +93,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
Database changed
|
||||
mysql>
|
||||
|
||||
### 6. How will you get the list of all the tables, in a database? ###
|
||||
### 问题6:如何列出某个数据库内所有表? ###
|
||||
|
||||
> **Answer** : To list all the tables of a database use the command on mysql shell as: **show tables**;
|
||||
> **答案**:在当前数据库运行命令 **show tables;**
|
||||
|
||||
mysql> show tables;
|
||||
+----------------------------+
|
||||
@ -113,9 +114,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+----------------------------+
|
||||
10 rows in set (0.00 sec)
|
||||
|
||||
### 7. How will you get the Field Name and Type of a MySql table? ###
|
||||
### 问题7:如何获取表内所有 Field 对象的名称和类型? ###
|
||||
|
||||
> **Answer** : To get the Field Name and Type of a table use the command on mysql shell as: **describe table_name**;
|
||||
> **答案**:运行命令 **describe table_name;** 查看名为 table_name 的表。
|
||||
|
||||
mysql> describe oc_users;
|
||||
+----------+--------------+------+-----+---------+-------+
|
||||
@ -126,25 +127,25 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+----------+--------------+------+-----+---------+-------+
|
||||
2 rows in set (0.00 sec)
|
||||
|
||||
### 8. How will you delete a table? ###
|
||||
### 问题8:如何删除表? ###
|
||||
|
||||
> **Answer** : To delte a specific table use the command on mysql shell as: **drop table table_name**;
|
||||
> **答案**:运行命令 **drop table table_name;**
|
||||
|
||||
mysql> drop table lookup;
|
||||
|
||||
Query OK, 0 rows affected (0.00 sec)
|
||||
|
||||
### 9. What about database? How will you delete a database? ###
|
||||
### 问题9:如何删除数据库? ###
|
||||
|
||||
> **Answer** : To delte a specific database use the command on mysql shell as: **drop database database-name**;
|
||||
> **答案**:运行命令 **drop database database-name;**
|
||||
|
||||
mysql> drop database a1;
|
||||
|
||||
Query OK, 11 rows affected (0.07 sec)
|
||||
|
||||
### 10. How will you see all the contents of a table? ###
|
||||
### 问题10:如何查看表内所有数据? ###
|
||||
|
||||
> **Answer** : To view all the contents of a particular table use the command on mysql shell as: **select * from table_name**;
|
||||
> **答案**:运行命令 **select * from table_name;**
|
||||
|
||||
mysql> select * from engines;
|
||||
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
|
||||
@ -161,9 +162,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+------------+---------+----------------------------------------------------------------+--------------+------+------------+
|
||||
8 rows in set (0.00 sec)
|
||||
|
||||
### 11. How will you see all the data in a field (say, uid), from table (say, oc_users)? ###
|
||||
### 问题11:如何从 oc_users 这个表获取一个 field 对象(比如 uid)的所有数据? ###
|
||||
|
||||
> **Answer** : To view all the data in a field use the command on mysql shell as: **select uid from oc_users**;
|
||||
> **答案**:运行命令 **select uid from oc_users;**。
|
||||
|
||||
mysql> select uid from oc_users;
|
||||
+-----+
|
||||
@ -173,9 +174,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+-----+
|
||||
1 row in set (0.03 sec)
|
||||
|
||||
### 12. Say you have a table ‘xyz’, which contains several fields including ‘create_time’ and ‘engine’. The field ‘engine’ is populated with two types of data ‘Memory’ and ‘MyIsam’. How will you get only ‘create_time’ and ‘engine’ from the table where engine is ‘MyIsam’? ###
|
||||
### 问题12:假设你有一个表,名为 ‘xyz’,存在多个 field,如 create_time 和 engine。名为 engine 的 field 由 ‘Memoty’ 和 ‘MyIsam’ 两种数值组成。如何只列出 create_time 和 engine 这两列并且 engine 的值为 ‘MyIsam’? ###
|
||||
|
||||
> **Answer** : Use the command on mysql shell as: **select create_time, engine from xyz where engine=”MyIsam”**;
|
||||
> **答案**:运行命令 **select create_time, engine from xyz where engine = ”MyIsam”;**
|
||||
|
||||
mysql> select create_time, engine from xyz where engine="MyIsam";
|
||||
|
||||
@ -200,9 +201,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+---------------------+--------+
|
||||
132 rows in set (0.29 sec)
|
||||
|
||||
### 13. How will you show all the records from table ‘xrt’ where name is ‘tecmint’ and web_address is ‘tecmint.com’? ###
|
||||
### 问题13:如何列出表 ‘xrt’ 内 name 域值为 ‘tecmint’,web_address 域值为 ‘tecmint.com’ 的所有数据? ###
|
||||
|
||||
> **Answer** : Use the command on mysql shell as: **select * from xrt where name = “tecmint” and web_address = “tecmint.com”**;
|
||||
> **答案**:运行命令 **select * from xrt where name = “tecmint” and web_address = “tecmint.com”;**
|
||||
|
||||
mysql> select * from xrt where name = "tecmint" and web_address = “tecmint.com”;
|
||||
+---------------+---------------------+---------------+
|
||||
@ -213,9 +214,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
| 41 | tecmint | tecmint.com |
|
||||
+---------------+---------------------+----------------+
|
||||
|
||||
### 14. How will you show all the records from table ‘xrt’ where name is not ‘tecmint’ and web_address is ‘tecmint.com’? ###
|
||||
### 问题14:如何列出表 ‘xrt’ 内 name 域值_不_为 ‘tecmint’,web_address 域值为 ‘tecmint.com’ 的所有数据? ###
|
||||
|
||||
> **Answer** : Use the command on mysql shell as: **select * from xrt where name != “tecmint” and web_address = “tecmint.com”**;
|
||||
> **答案**:运行命令 **select * from xrt where name != "tecmint" and web_address = "tecmint.com";**
|
||||
|
||||
mysql> select * from xrt where name != ”tecmint” and web_address = ”tecmint.com”;
|
||||
|
||||
@ -225,9 +226,9 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
| 1173 | tecmint | tecmint.com |
|
||||
+---------------+---------------------+----------------+
|
||||
|
||||
### 15. You need to know total number of row entry in a table. How will you achieve it? ###
|
||||
### 问题15:你需要知道表内行数,这个该怎么做?
|
||||
|
||||
> **Answer** : Use the command on mysql shell as: **select count(*) from table_name**;
|
||||
> **答案**:运行命令 **select count(*) from table_name;**
|
||||
|
||||
mysql> select count(*) from Tables;
|
||||
|
||||
@ -238,7 +239,7 @@ Prior to This Article, three articles has already been published in ‘[Linux In
|
||||
+----------+
|
||||
1 row in set (0.01 sec)
|
||||
|
||||
That’s all for now. How you feel about this ‘**Linux Interview Question**‘ section. Don’t forget to provide us with your valuable feedback in our comment section.
|
||||
以上是文章的所有内容。你觉得这篇‘**Linux 面试题回答**’对你有任何帮助吗?别忘了在下面留言,写上你的意见。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -0,0 +1,105 @@
|
||||
Linux id 命令 - 打印用户id和组id信息
|
||||
================================================================================
|
||||
要登入一台计算机,我们需要一个用户名。用户名是一个被计算机识别的身份。基于此,计算机会对使用这个用户名的登陆的人应用一系列的规则。在Linux系统下,我们可以使用**id**命令。
|
||||
|
||||
### 什么是id命令 ###
|
||||
|
||||
**id** 命令可以打印真实并有效的用户ID(UID)和组ID(GID)。UID是对一个用户的唯一标识。组ID(GID)可以包含多个UID。
|
||||
|
||||
### 如何使用 ###
|
||||
|
||||
默认上,**id**命令已经预装在大多数Linux系统中。要使用它,只需要在你的控制台输入id。不带选项输入id会显示如下。结果会使用活跃用户。
|
||||
|
||||
$ id
|
||||
|
||||
![id默认输出](http://linoxide.com/wp-content/uploads/2013/12/id_default.png)
|
||||
|
||||
#### 如何读取输出t : ####
|
||||
|
||||
- 用户 **pungki** 的 **UID** 号码 = **1000**, **GID** 号码 = **1000**
|
||||
- 用户 **pungki ** 是下面的组成员 :
|
||||
|
||||
**pungki** with GID = **1000**
|
||||
**adm** with GID = **4**
|
||||
**cdrom** with GID = **24**
|
||||
**sudo** with GID = **27**
|
||||
**dip** with GID = **30**
|
||||
**plugdev** with GID = **46**
|
||||
**lpadmin** with GID = **108**
|
||||
**sambashare** with GID = **124**
|
||||
|
||||
### 带选项使用id ###
|
||||
|
||||
id命令可以使用一些选项。下面有一些在日常使用中有用的选项。
|
||||
|
||||
#### 打印用户名, 该UID所属的所有组 ####
|
||||
|
||||
要这么做,我们可以使用**-a** 选项
|
||||
|
||||
$ id -a
|
||||
|
||||
![-a 选项](http://linoxide.com/wp-content/uploads/2013/12/id_a.png)
|
||||
|
||||
#### 输出所有不同的组ID (有效的,真实的和补充的) ####
|
||||
|
||||
我们可以使用 **-G**选项实现这个。
|
||||
|
||||
$ id -G
|
||||
|
||||
![-G 选项](http://linoxide.com/wp-content/uploads/2013/12/id_G.png)
|
||||
|
||||
结果只会显示GID号。你可以和**/etc/group**文件比较。下面是**/etc/group**文件的示例内容:
|
||||
|
||||
root:x:0:
|
||||
daemon:x:1:
|
||||
bin:x:2:
|
||||
sys:x:3:
|
||||
adm:x:4:pungki
|
||||
fax:x:21:
|
||||
voice:x:22:
|
||||
cdrom:x:24:pungki
|
||||
floppy:x:25:
|
||||
tape:x:26:
|
||||
sudo:x:27:pungki
|
||||
audio:x:29:pulse
|
||||
dip:x:30:pungki
|
||||
www-data:x:33:
|
||||
backup:x:34:
|
||||
operator:x:37:
|
||||
sasl:x:45:
|
||||
plugdev:x:46:pungki
|
||||
ssl-cert:x:107:
|
||||
lpadmin:x:108:pungki
|
||||
saned:x:123:
|
||||
sambashare:x:124:pungki
|
||||
winbindd_priv:x:125:
|
||||
|
||||
#### 只输出有效的组ID ####
|
||||
|
||||
使用 **-g** 选项来只输出有效组ID。
|
||||
|
||||
$ id -g
|
||||
|
||||
![-g 选项](http://linoxide.com/wp-content/uploads/2013/12/id_g1.png)
|
||||
|
||||
#### 打印特定用户信息 ####
|
||||
|
||||
我们可以输出特定的用户信息相关的UID和GID。只需要在id命令后跟上用户名。
|
||||
|
||||
$ id leni
|
||||
|
||||
![leni 用户](http://linoxide.com/wp-content/uploads/2013/12/id_leni.png)
|
||||
|
||||
上面的命令会打印用户**leni**的UID和GID。
|
||||
|
||||
### 总结 ###
|
||||
|
||||
当我们想知道某个用户的UID和GID时是非常有用的。一些程序可能需要UID/GID来运行。id使我们更加容易地找出用户的UID以GID而不必在/etc/group文件中搜寻。像往常一样,你可以在控制台输入**man id**进入id的手册页来获取更多的细节。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://linoxide.com/linux-command/linux-id-command/
|
||||
|
||||
译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
@ -0,0 +1,66 @@
|
||||
Linux的天赋在于社区,而非科技
|
||||
================================================================================
|
||||
> Linux从未兑现最初的承诺---作为一款老派的桌面操作系统. 然而在2013年中,在社区的驱动下,它变得无处不在。
|
||||
|
||||
2013年,从各方面看,都是属于Linux的一年。Linux基金会执行董事Jim Zemlin宣布Linux的已经普及到了运算的每一个角落。“从智能手机,平板电脑,消费电器和汽车,到开放云和高性能计算机,以及游戏平台等,是Linux一直是几乎无处不在的,” [Zemlin 说][1].
|
||||
|
||||
Linux是如何蔓延到技术世界的每一个角落?毕竟,Linux并未真正实现其最初的承诺---成为一款取代Microsoft和Windows的老派的桌面操作系统。内核和代码都只是这个故事的一部分。Linux的无所不在归结为它在激发和凝聚社区方面的能力,而非出众的技术。
|
||||
|
||||
### 足够好,但仍然有一些缺陷 ###
|
||||
|
||||
话虽如此,我们并非认为如果技术较为落后,Linux仍旧会取得今天的成就。正如甲骨文公司的负责Linux,MySQL和虚拟化和开源产品营销的高级主管莫妮卡·库马尔[所说][2],“没有卓越的技术,优越的社会就不会团结在Linux操作系统周围。” 这是任何成功的开源项目的 [关键组件之一][3],即伟大的初始代码。
|
||||
|
||||
然而,这还不够。
|
||||
|
||||
当刚被推出的时候,Linux是一个廉价的,“足够好”的替代专有UNIX的系统。但是,并未做到更好。事实上,在最早开发Linux后的10多年间,[InfoWorld仍能令人信服地声称][4],“作为UNIX的变种,相比于Linux操作系统,Solaris是技术优越的操作系统”。UNIX,毕竟是定位于一个相对狭窄的应用程序和硬件类型,允许其供应商大力优化它的建议工作负载。
|
||||
|
||||
[正如IBM所解释的那样][5],Linux恰恰相反:
|
||||
|
||||
> GNU / Linux的发展...比UNIX更加多样化。开发人员来自许多不同的背景,因此有不同的经验和想法。在Linux社区内部,目前还没有一套严格的标准的工具,环境和功能....由于缺乏标准,导致LInux中出现明显的不一致性。
|
||||
|
||||
有趣的是,这也赋予了Linux最大的优势:适用于所有用户的能力。
|
||||
|
||||
### 为何社区喜爱Linux ###
|
||||
|
||||
但为什么Linux?考虑到当Linux推出时,对于大多数任务来说,只是勉强足够使用,是什么促使一个社区形成的?Ubuntu Linux制造商Canonical的OEM部门主管,Brent Fox,认为相对于失败的风险,一个公共平台的回报更加诱人。
|
||||
|
||||
> [@mjasay][6] 在很长一段时间内,该技术本身是不成熟的。正是扰乱既定操作系统使用者的潜力,吸引了一大群人
|
||||
> — Brent Fox (@brentfox) [December 19, 2013][7]
|
||||
|
||||
这些基本上来说是对的,但它与历史并不完全相符。毕竟,Linux的最早倡导者之一,是一个有庞大的UNIX的业务需要保护的公司:IBM。IBM需要Linux来统一其不同的硬件线路,并且看到了在Linux上搭建一个更大的硬件和服务业务的潜力,即使以某些UNIX的收入为代价。
|
||||
|
||||
现如今,Linux成为许多数十亿美元级别公司的心脏。据["Who Writes Linux?"报告反映][8],什么开始成为Linus Torvalds的黑客已经成为世界上一些大公司和最好的开发者关注的焦点,。
|
||||
|
||||
### 通过多样性所获得的优势 ... 以及Linus ###
|
||||
控制冲突的能力,以及有时在一面旗帜下控制竞争利益的能力使得Linux变得如此成功。它促使不同的公司和个人开发者通过塑造Linux来满足他们的需求。正如Apache软件基金会主席吉姆[Jagielski告诉我的那样][9],和建立一个健康的可行的社区相比,“建立内核较为容易,Linux之所以能够成功,是因为它有一个成功的社区。”
|
||||
|
||||
寻求和发现Linux成功之处的顶级Linux开发赞助商名单:
|
||||
|
||||
![](http://readwrite.com/files/Screen%20Shot%202013-12-19%20at%208.58.36%20AM.png)
|
||||
|
||||
支撑这种多样性的是[Linus Torvald的非凡的领导][10]“。由于许多人试图令Linux私有化,托沃兹已经设法让由他的权威所支持的Lin对这种行为说“不” 它工作得很好,但拥有足够的弹性,来让公司提供驱动程序或其他技术,使得Linux非常适合他们的客户。
|
||||
|
||||
Linux技术尽管已经变得如此神奇,然而,它并非Linux的最大优势。正如Zemlin在电子邮件中告诉我的那样:
|
||||
|
||||
> 这些天,我并没有得到许多关于Linux的询问,尽管到处都在使用它。许多公司想知道如何最大限度地发挥它的性能以及如何将它的原理应用于其他的事情。这便是我所感兴趣的问题:社区是如何工作的。
|
||||
|
||||
伟大的技术一直都在被创造。然而大多数都没能找到观众。Linus Torvalds以及他所塑造的Linux开发商的天赋在于,他所开创和完善的社会发展模式。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: http://readwrite.com/2013/12/19/the-genius-of-linux-is-community-not-technology#feed=/hack
|
||||
|
||||
译者:[tomatoKiller](https://github.com/tomatoKiller) 校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
|
||||
|
||||
[1]:http://www.linuxfoundation.org/news-media/blogs/browse/2013/12/2013-year-linux-the%E2%80%A6everything
|
||||
[2]:https://twitter.com/mbkumar/status/413689410308173825
|
||||
[3]:http://asay.blogspot.com/2005/09/so-you-want-to-build-open-source.html
|
||||
[4]:http://www.infoworld.com/t/platforms/seven-ways-solaris-can-beat-linux-978
|
||||
[5]:http://www.ibm.com/developerworks/aix/library/au-unix-difflinux.html
|
||||
[6]:https://twitter.com/mjasay
|
||||
[7]:https://twitter.com/brentfox/statuses/413696557620293632
|
||||
[8]:http://www.linuxfoundation.org/publications/linux-foundation/who-writes-linux-2013
|
||||
[9]:https://twitter.com/jimjag/status/413704747791970304
|
||||
[10]:http://readwrite.com/2013/08/27/linux-turns-22-but-open-source-is-eternal
|
Loading…
Reference in New Issue
Block a user