20131209-4 选题

This commit is contained in:
DeadFire
2013-12-09 16:21:24 +08:00
parent 9b8dce00d1
commit 291c5e26d7
4 changed files with 337 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
7 Tips For Becoming A Linux Terminal Power User
================================================================================
The Linux terminal is much more than merely entering commands into it. If you master the basic tricks, it will assist you in mastering the Bash shell that is used as default on a number of Linux distributions.
As stated on howtogeek.com, here are some tips for new users as well as advanced users who may have missed out on something along the way-
**1. Tab Completion** This saves time and is also handy if youre unsure of a file or commands exact name. For instance, theres a file named “really long file name” in the current directory and you wish to delete it. You can type the entire file name, however, you will have to ensure that you escape the space characters properly. In case of multiple files in the current directory which start with the letter r, Bash will not be aware of the one you want.
In the event you have another file named “really very long file name” in the current directory and you hit Tab. Bash will fill in the “really\ “ part for both the files start with that. Post that press Tab again and youll find a list of matching file names.
**2. Pipes** This permits you to transmit the output of a command to another command. In the UNIX philosophy, every program is a small utility that performs one thing well. For instance, the ls command lists out the files in the current directory and the grep command searches its input for a specified term.
You can combine these with pipes (the | character) and search for a file in the current directory. The command given below searches for the word “word”:
ls | grep word
**3. Wild Cards** - The * (asterisk) character is a wild card for matching anything. For instance, if you want to delete both “really long file name” and “really very long file name” from the current directory, you can run the following command:
rm really*name
This command deletes all files with file names starting with “really” and ending with “name.” However, in case you ran rm * instead, you would end up deleting every file in the current directory.
**4. Output Redirection** - The > character redirects a commands output to a file in place of another command. For instance, the following line runs the ls command to list the files in the current directory and in lieu of printing that list to the terminal, it prints to a file named “file1” in the current directory:
ls > file1
**5. Command History** Bash memorizes history of the commands you enter into it. The up and down arrow keys can be used to scroll through recent commands used by you. The history command prints out a list of these commands for piping it to grep in order to search for commands used by you recently.
~, . & ..
The ~ character also called the tilde is used to show the current users home directory. So in lieu of typing cd /home/name for going to your home directory, you can type cd ~. This also functions with relative paths cd ~/Desktop to go to the current users desktop.
In the same way, the . is for the current directory and the .. is for the directory above the current directory. So, cd .. goes up a directory. It functions with relative paths for instance when you are in your Desktop folder and wish to go to the Documents folder, that is in the same directory as the Desktop folder, you can make use of the cd ../Documents command.
**6. Running a Command in the Background** Bash by default executes every command that is run by you in the current terminal. Its normally okay but what if you wish to launch an application and maintain utilizing the terminal? By typing firefox for launching Firefox, it will take charge of your terminal and show error messages and other output till you have closed it. You can use the & operator to the end of the command for Bash to execute the program in the backdrop.
firefox &
**7. Conditional Execution** Bash can also run two commands sequentially. The second command can only execute when the first command is completed with success. For doing this, you can put both commands on the same line segregated by a &&, or double ampersand. The command given below will wait for five seconds, and start the gnome-screenshot tool:
sleep 5 && gnome-screenshot
--------------------------------------------------------------------------------
via: http://www.efytimes.com/e1/fullnews.asp?edid=123564
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:
[2]:
[3]:
[4]:
[5]:
[6]:
[7]:
[8]:
[9]:
[10]:
[11]:
[12]:

View File

@@ -0,0 +1,99 @@
How to Upgrade to GNOME 3.10 in Ubuntu 13.10
================================================================================
![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/header-bars.jpg)
**Ubuntu 13.10 ships with the GNOME 3.8 desktop available in its archives. While a dependable, stable and featured alternative to Unity, its also outdated.**
The newer version of the GNOME desktop was released back in September 2013 and comes with a raft of improved features, apps and usability tweaks. From hi-res screen support to new client-side decoration of app windows, GNOME 3.10 is a compelling upgrade.
The good news is that providing youre running Ubuntu 13.10, have a decent internet connection, and some command line aptitude (pun fully intended) you dont have to stick with a stale version of GNOME.
### How To Upgrade to GNOME 3.10 in Ubuntu 13.10 ###
For the benefit of the skim readers whose eyes dropped straight to the point Ill reiterate: you **need to be running Ubuntu 13.10 to install GNOME 3.10**.
First, lets add the GNOME 3 PPA to Ubuntus Software Sources. This can be done using a GUI but it is far easier to achieve using the command line.
Open a new *Terminal* window and enter the following command, entering your user password when asked:
sudo add-apt-repository ppa:gnome3-team/gnome3-next && sudo apt-get update
With the PPA added and our package list updated we can move on to installing GNOME 3.10 itself. To do this run the following command, again entering your user password when prompted:
sudo apt-get update && sudo apt-get install gnome-shell ubuntu-gnome-desktop
It can take a while for all the necessary packages and components to be fetched and installed, so try to be patient.
Midway through the installation a prompt will appear in the Terminal asking you to choose what display manager aka “login screen” should be used by default.
This decision is entirely up to you; both Ubuntus Unity Greeter and the **GNOME Display Manager** let you easily switch between desktop sessions (handy if you want to keep Unity or another desktop around) but only GDM offers GNOME-specific features such as lock-screen notifications.
When youre ready to decide make your selection using the up/down arrow keys and hit Enter/Return to confirm. The installation will then proceed.
### Adding The Extra Stuff ###
![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/09/gnome-music.jpg)
GNOME 3.10 comes with some great new features, applications [including GNOME Weather, Music and Maps][1] and other miscellaneous changes. Because not all of these are considered stable enough to be included in the main GNOME 3 PPA we added earlier, youll need to make use of an additional pair of GNOME PPAs if you want to use them.
Now and its important youre aware of this some of the packages in these repositories are reported to have stability issues. Most of these will be minor i.e., the odd app crash or broken feature but the potential for more major issues, like making GNOME crash entirely, is possible.
Warning out of the way, open up a new tab in a Terminal and punch in the following:
sudo add-apt-repository ppa:gnome3-team/gnome3-staging
sudo add-apt-repository ppa:gnome3-team/gnome3
sudo apt-get update && sudo apt-get dist-upgrade
To add some of the cool apps we mentioned earlier run:
sudo apt-get install gnome-weather gnome-music gnome-maps cheese gnome-documents
With that were done!
You may wish to log out and back in (remembering to select the GNOME session) to ensure that everything takes effect correctly.
### Minor Differences ###
If youve kept Unity installed alongside GNOME 3.10 then there are a few things youll need to note down.
First off, youll find **two entries for Online Accounts in System Settings**. The one with the key-themed icon is the Unity version, and the one with the plug emblem is GNOMEs.
Some apps will require you to add accounts to the Unity version (Shotwell, Gwibber, Empathy) and some to the GNOME one (Evolution, Documents, Contacts).
![](http://www.omgubuntu.co.uk/wp-content/uploads/2013/04/online-accounts.jpg)
The Notifications and Search entries are GNOME-specific, both letting you pick and choose which applications and sources are able to show notifications or appear in the Activities Overlay.
### Uninstalling GNOME 3.10 ###
So youve tried it and didnt like it. Now what?
Removing GNOME 3.10 is a fairly straightforward processing providing we use a command-line tool called PPA Purge. It can be found in the Ubuntu Software Center and is by far the easiest way to automatically remove and/or downgrade packages installed from PPAs.
- [Install PPA Purge from Ubuntu Software Center][2]
To use the tool well need to go back to the terminal and enter the following, taking care to look out for any prompts that may appear during the downgrade process.
sudo ppa-purge ppa:gnome3-team/gnome3-next
If you also added the optional extra PPAs you will also need to purge those as well:
sudo ppa-purge ppa:gnome3-team/gnome3-staging
sudo ppa-purge ppa:gnome3-team/gnome3
Once completed you should be left with the stock GNOME 3.8 desktop. If you dont want to keep GNOME Shell around at all you can proceed to remove it:
sudo apt-get remove gnome-shell ubuntu-gnome-desktop
Finally, manually remove any remaining applications that persist after downgrade (e.g., Epiphany and GNOME Documents), then reboot.
--------------------------------------------------------------------------------
via: http://www.omgubuntu.co.uk/2013/12/upgrade-gnome-3-10-ubuntu-13-10
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.omgubuntu.co.uk/2013/09/gnome-3-10-released-with-new-apps-experimental-wayland-support
[2]:apt:ppa-purge

View File

@@ -0,0 +1,142 @@
Linux date command Display and Set System Date and Time
================================================================================
![](http://linoxide.com/wp-content/uploads/2013/12/date-linux-command.jpg)
Date on the operating system may only be considered as a timepiece. Especially on console mode, we do generally not see date as an important think. But for Administrator, this assumption is false. Do you know that a wrong date and time can make you cant compile an application?
Because date and time is important, this is may be the reason why Network Time Protocol is developed. Lets start to see what date command do for you.
### Display system date ###
To display your system date, just type
$ date
Thu Dec 5 22:55:41 WIB 2013
### Formatting Date ###
Date come with many formats. If you are unhappy with default format you can change it. You may think “Why I need to change the format? A default output is enough for me”.
Yes. It is true. But when you do programming, default output may not meet the user need. So heres some custom outputs.
### Output date and time in RFC 2822 format ###
$ date -R
Thu, 05 Dec 2013 23:40:53 +0700
**RFC 2822** has a format like this : **day, date-month-year, hours:minutes:second timezone**
Timezone +0700 is same with GMT +7
By default **date** is using the timezone which defined in **/etc/localtime**. Valid timezones data are defined in **/usr/share/timezones**
### Print or set Coordinated Universal Time ###
From [Wikipedia][1], UTC means
> The primary standard which the world regulates clocks and time. It is one several closely related successors to Greenwich Mean Time.
To display your date and time with UTC format, use -u parameter
$ date -u
Thu Dec 5 16:45:58:UTC 2013
### Using formatting options ###
To custom your date format, **use a plus sign (+)**
$ date +”Day : %d Month : %m Year : %Y”
Day: 05 Month: 12 Year: 2013
$ date +%D
12/05/13
**%D** format follows **Year/Month/Day format**.
You can also put the day name if you want. Heres some examples :
$ date +”%a %b %d %y”
Fri 06 Dec 2013
$ date +”%A %B %d %Y”
Friday December 06 2013
$ date +”%A %B %d %Y %T”
Friday December 06 2013 00:30:37
$ date +”%A %B-%d-%Y %c”
Friday December-06-2013 12:30:37 AM WIB
There are still a lot of format options available. Just type
$ date help
Or
$ man date
To show date command syntax and parameters.
So basically, date command will interpret all percent sign (%) and print anything inside a quotes sign (“ “)
### Set system date and time ###
Generally, you want your system date and time is set automatically. If for some reason you have to change it manually, we can use this command :
# date set=”20140125 09:17:00”
It will **set** your current date and time of your system into **January 25, 2014 and 09:17:00 AM. Please note**, that you **must** have root privilege to do this. Otherwise you will have an error message like this :
date: cannot set date: Operation not permitted
Sat Jan 25 09:17:00 WIB 2014
### Reset your time back ###
If you need to reset your system date and time back to the original, you can do this trick.
# hwclock
Fri 06 Dec 2013 03:44:10 AM WIB -0.314082 seconds
And set your system date and time to the output of hwclock command.
### Using date command on a script ###
Remember when I said before about why you may need to change the date output? One of the answer may be because you do programming. Lets see an example on bash script.
$ vi display.date
#! /bin/bash
DATETIME=$(date +”DATE: %a %b-%d-%Y TIME: %T WEEK NUMBER: %W”)
echo $DATETIME
Save it and run it using :
$ ./display.date
DATE : Fri Dec-06-2013 TIME: 03:08:19 WEEK Number :40
If you find error permission denied error message, type :
$ chmod 755 display.date
### Using date on a backup procedure ###
Another example is when you are using date on a backup procedure.
$ date +%F
2013-12-06
$ tar zcfv /daily_backup/backup-`date +%F`.tar.gz /home/pungki/Documents
It will compress folder **/home/pungki/Documents** into a a file with name **backup-2013-12-06.tar.gz** which located in **/daily_backup folder**.
### Conclusion ###
Date may be seen as something that is not important. But dates play an important role. As usual, to have more detail in using date command, please visit date manual page by typing man date in your console.
--------------------------------------------------------------------------------
via: http://linoxide.com/linux-command/date-command-linux/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://en.wikipedia.org/wiki/Coordinated_Universal_Time

View File

@@ -0,0 +1,34 @@
Top Email Encryption Tools
================================================================================
Email continues to be one of the most popular and useful functions of a Linux system. Being able to keep in touch with your friends, family, and colleagues is essential for any platform. As the scope of email threats keeps increasing, systems for email security and encryption have become more complex and more of a necessity. Protecting email from unauthorized access and inspection is important particularly because the protocols that govern email do not include encryption. Email was not designed with any privacy or security in mind. The consequence of the lack of security is that email can be compromised on the sender's device, on a network, on a server, and on the recipient's device.
Sending encrypted messages is one method of ensuring electronic privacy. By encrypting messages, this will help to keep your precious information safe by making messages look like garbled text to uninvited onlookers. Encrypting email may sound a little daunting, but it's actually simple with the right software.
OpenPGP is the most widely used email encryption standard. Whether you are using an email client or a web-based email solution, you can encrypt your email with OpenPGP.
There are very few email applications that have PGP encryption enabled by default. Fortunately, there are some good open source encryption applications available for Linux that are simple to use.
To provide an insight into the quality of software that is available, we have compiled the following list of email encryption tools.
Now, let's explore the 4 encryption tools at hand. For each title we have compiled its own portal page, a full description with an in-depth analysis of its features, together with links to relevant resources and reviews.
### Email Encryption Tools ###
- [Enigmail][1] OpenPGP Email Security for Mozilla Applications
![](http://www.linuxlinks.com/portal/content/reviews/Email/Screenshot-Enigmail.png)
- [Mailvelope][2] Extension for Google Chrome and Mozilla Firefox
- [GnuPG][3] Encrypt and sign data and communication
- [Mymail-Crypt for Gmail][4] Simple solution to mail encryption
--------------------------------------------------------------------------------
via: http://www.linuxlinks.com/article/2013120707481589/EmailEncryption.html
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.enigmail.net/
[2]:http://www.mailvelope.com/
[3]:http://www.gnupg.org/
[4]:https://chrome.google.com/webstore/detail/mymail-crypt-for-gmail/jcaobjhdnlpmopmjhijplpjhlplfkhba