选题20131022-3

This commit is contained in:
wxy 2013-10-22 18:53:49 +08:00
parent 6e779214a9
commit 9b85d23bb6
9 changed files with 730 additions and 0 deletions

View File

@ -0,0 +1,33 @@
Daily Ubuntu Tips How To Change Your Computer Name
================================================================================
Another blog post that is geared towards new Ubuntu users or newbies. This post shows you how to easily change your computer name when using Ubuntu. Many users will never worry about changing their computer name or hostname in Ubuntu. In most cases, thats the least of their worries.
Many will use the name that was created or given to the machine during Ubuntu installation. But for those new users who would like to know how to do it, continue below to learn how. This post isnt for pros, its for newbies and users who are just starting out with Ubuntu.
So, why would you want to change your computer name again? If you dont have a good reason other than to learn how to do it, then dont. If you want to do it for a good reason or learn how to do it, then do this.
Press **Ctrl Alt T** on your keyboard to open the terminal. When it opens, run the commands below to edit the hostname file using gedit.
sudo gedit /etc/hostname
Next, change whatever in there to be the new computer name. For example, if you want your computer name to be RDOMNU, delete whats currently in there and type **RDOMNU** and save the file.
Next, run the commands below to open the hosts file.
sudo gedit /etc/hosts
Then change the value of the second line highlighted below to match your computer name you entered earlier. Save the file when youre done.
![](http://www.liberiangeek.net/wp-content/uploads/2013/10/ubuntuhostnamechange.png)
Thats it! Restart your computer and your machine will reflect the new name. This is how one changes the name of a Ubuntu machine.
Enjoy!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/10/daily-ubuntu-tips-change-computer-name/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,33 @@
Disable Amazon & Remote Content Fetching In Ubuntu 13.10
================================================================================
Now that Ubuntu 13.10 has been released, its now time to sit back and configure some settings that will suit your needs. Ubuntu 13.10 comes with many things and some of those may not be what you want when you install or upgrade Ubuntu.
For example, when you install or upgrade to Ubuntu 13.10, youll automatically get Amazon and other commercial shopping scopes enabled. These lenses show up when you open Unity Dash. When you perform searches from Dash, content that matches your search terms will also be delivered from remote sources like Amazon as well.
These added features provided by Canonical may be good for some, but for few users, this may be something they dont want.
Because fetching content from remote sources requires bandwidth, this may have a negative impact on your Internet bill especially if you live in areas that charges based on usages.
For other users who may have security and privacy concerns, automatically searching remote sources from your local machine maybe not be the best idea. Some just dont want commercial companies showing their products to them when performing basic searches from their local machines.
This brief tutorial is going to show you how to quick disable Amazon and all remote content fetching when using Ubuntu 13.10.
To get started, press **Ctrl Alt T** on your keyboard to show the terminal or console. When it opens, run the commands below to disable the feature.
gsettings set com.canonical.Unity.Lenses remote-content-search 'none'
If you want to re-enable it, run the commands below.
gsettings set com.canonical.Unity.Lenses remote-content-search 'all'
Youll have to re-logon or restart your machine for the changes to take effect. After doing that, no remote sources will be use in your searches when using Ubuntu.
Enjoy!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/10/disable-amazon-remote-content-fetching-ubuntu-13-10/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,44 @@
Heres How To Enable DVD Playback In Ubuntu 13.10
================================================================================
If you find yourself struggling to play DVDs in Ubuntu 13.10 after installing, heres the reason why. You see, Ubuntu is always shipped with some limitations when it comes to playing DVDs and other media. For legal reasons, Canonical, the parent company of Ubuntu leaves out these packages and programs that are required to play DVDs and most media in Ubuntu.
I am not going to tell you what the reasons are, but heres how to get these packages in Ubuntu so you can play and watch commercial DVD as well as other encrypted media.
There are many options available to you. You could install free versions of these packages or get some paid versions if you want to help those behind the efforts of making Ubuntu media friendly.
Another method thats no longer available was to use Medibuntu repositories to install these packages which will allow you play DVDs. Now, Medibuntu has [stopped support][1] for Ubuntu 12.10 and up.
So, to play DVDs again in Ubuntu, follow the steps below.
[Purchase Fluendo DVD Player][2] this program is designed to help Ubuntu users play commercial DVDs. It supports full DVD playback, full screen and support for subtitles.
If you dont want to buy software that allows you to play DVDs, install these free tools.
Press **Ctrl Alt T** on your keyboard to open the terminal. When it opens, run the commands below.
sudo apt-get install ubuntu-restricted-extras
Next, run the commands below.
sudo apt-get install libavformat-extra-53 libavcodec-extra-53 libdvdread4
Finally, run the commands below and youre done.
sudo /usr/share/doc/libdvdread4/install-css.sh
You may have to restart your computer. After that, insert your DVD and try again. If all of the above steps fail, run the commands below to install VLC Player.
sudo apt-get install vlc
Enjoy!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/10/heres-enable-dvd-playback-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://gauvain.pocentek.net/node/61
[2]:https://apps.ubuntu.com/cat/applications/fluendo-dvd/

View File

@ -0,0 +1,30 @@
Open Virtualization Alliance joins the Linux Foundation
================================================================================
> But the developer community for OVA's Kernel-based Virtual Machine hypervisor project will remain separate and independent
IDG News Service - The Open Virtualization Alliance has joined the Linux Foundation as a collaborative project to deepen its ties with the Linux community.
The organizations announced their collaboration during the LinuxCon Europe conference in Edinburgh on Monday.
The Open Virtualization Alliance (OVA) has more than 250 member companies, including IBM, Red Hat, Intel and NetApp. It aims to raise awareness and drive adoption of the Kernel-based Virtual Machine (KVM) hypervisor, a full open source virtualization platform for Linux on x86 hardware that allows users to run multiple virtual machines unmodified on Linux or Windows images. KVM can be 60% to 90% cheaper than other virtualization platforms, while offering the same core functionality, according to the Alliance.
By joining the Linux Foundation as a collaborative project, the OVA seeks to deepen its ties with the broader Linux community, said Chuck Dubuque, the board chair for Open Virtualization Alliance and director of product marketing Red Hat-s Virtualization Business Unit, in an email. Together, they will work on KVM marketing and awareness and the Linux Foundation will increase its investments in KVM by hosting events such as the KVM Forum that started in Edinburgh on Monday, he added.
OVA joined the Foundation because of its track record of engaging the user and commercial communities associated with open source projects and its strong ties to the development community, making it the logical choice for a collaborative partner, said Dubuque. The KVM project itself however remains a separate and independent developer community, Dubuque added.
The Linux Foundation is happy to provide guidance to organizations that want to reduce operating costs, maximize promotional reach and increase participation in addition to its other activities, the Foundation said in a news release.
Advances in virtualization technologies are key to the growth of Linux in the enterprise and cloud computing, the Foundation said. In addition to hosting OVA, the Linux Foundation also hosts the Xen Project, an open source hypervisor that was [donated][1]. A to the Linux Foundation by Citrix in April to get input from a wider, more diverse group of contributors.
Loek is Amsterdam Correspondent and covers online privacy, intellectual property, open-source and online payment issues for the IDG News Service. Follow him on Twitter at [@loekessers][2] or email tips and comments to loek_essers@idg.com
--------------------------------------------------------------------------------
via: http://www.computerworld.com/s/article/9243373/Open_Virtualization_Alliance_joins_the_Linux_Foundation?taxonomyId=122
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.pcworld.com/article/2034663/citrix-bequeaths-xen-to-the-linux-foundation.html
[2]:http://www.twitter.com/loekessers

View File

@ -0,0 +1,25 @@
Tuxmachines.org for sale
================================================================================
![](http://www.tuxmachines.org/images/forsale.jpg)
I've decided to try and see if anyone might be interested in buying and doing something with my domain and site. So, today, I'm posting this ad here: tuxmachines.org for sale.
I'm just getting too old and tired to keep the site up with way it and its loyal visitors deserve. It may get better next spring, but this fall I'll end up losing all my visitors I'm afraid.
I don't have any unrealistic ideas of what this site is worth or what anyone might pay, especially these days. I'll entertain any offer and will probably accept much lower than one might think.
So, if you'd like to have your own Linux site and don't want to start from scratch, here's a perfect choice. You'll get the artwork, theme, database, files, pictures, domain name (and anything else I may have forgotten) - or just the domain - whatever you want.
Just make an offer to srlinuxx at gmail dot com.
PS. I guess if the site doesn't sell, things will continue to be slow through the new year, but I'm hoping things will be better then*. I'll continue to do my best, so, keep your bookmarks or news feeds, please.
\* I'll blog more about this later.
--------------------------------------------------------------------------------
via: http://www.tuxmachines.org/node/61585
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出

View File

@ -0,0 +1,51 @@
Upgrade To Linux Kernel 3.11.6 In Ubuntu
================================================================================
Ubuntu 13.10 may have been released yesterday but chances are youre still running Linux Kernel 3.11.0. Sticking with the current kernel in Ubuntu 13.10 isnt a bad thing. In fact, its not always recommended to upgrade Linux Kernel outside of your Linux distributions official repositories tested for a particular version.
On the other hand, you should upgrade to the latest Linux Kernel in Ubuntu if it becomes available and if youre not afraid breaking breaking something in Ubuntu. You see, the latest kernel always comes with enhancements, bug fixes and some additional features.
So, if something isnt working quite right on your computer, upgrading the Linux Kernel might just fix it. But keep in mind that you may also break something when you upgrade.
If youre not afraid and want to jump right in with me, lets get started with upgrading to Linux Kernel 3.11.6 in Ubuntu.
First, before you start upgrading, backup your machine because you may never recover if something goes wrong. Better safe than sorry.
Fore more about this kernel version, [read this changelog][1].
When youre ready, run the commands below to upgrade your machine and remove any obsolete packages, including older kernels
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
ext, change into the /tmp directory.
cd /tmp
Then copy and paste the line below and press enter to download the 32-bit version of the Linux Kernel.
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/linux-headers-3.11.6-031106-generic_3.11.6-031106.201310181453_i386.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/linux-headers-3.11.6-031106_3.11.6-031106.201310181453_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/linux-image-3.11.6-031106-generic_3.11.6-031106.201310181453_i386.deb
To download the 64-bit version of the Linux Kernel, copy and paste the line below.
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/linux-headers-3.11.6-031106-generic_3.11.6-031106.201310181453_amd64.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/linux-headers-3.11.6-031106_3.11.6-031106.201310181453_all.deb http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.11.6-saucy/linux-image-3.11.6-031106-generic_3.11.6-031106.201310181453_amd64.deb
After downloading the correct version, run the commands below to begin installing it.
sudo dpkg -i *.deb
Finally, run the commands below to upgrade Grub.
sudo update-grub2
Thats it! Restart your computer and your machine should have the latest version.
Enjoy!
--------------------------------------------------------------------------------
via: http://www.liberiangeek.net/2013/10/upgrade-linux-kernel-3-11-6-ubuntu/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:https://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.11.6

View File

@ -0,0 +1,264 @@
di Disk Information Utility, Better Than df
================================================================================
If you are a Linux command line user, you would have definitely used the df command to check disk usage for file systems. Though df is a popular command but still it does not provide some advanced features like actual disk space that is available to a user, various useful display formats etc. There is another command line utility available that not only provides these advanced features but also all the features that df provides. In this article, we will discuss the disk information utility — **di**.
**NOTE** If you want to more about df, check out [the df command tutorial][1].
### di The Disk Information Utility ###
![](http://mylinuxbook.com/wp-content/uploads/2013/10/di-main.png)
It is evident from this snapshot of dis manual page that this utility provides some valuable features and hence makes it worth using. Lets try out some practical examples of this utility.
### Testing Environment ###
- OS Ubuntu 13.04
- Shell Bash 4.2.45
- Application di 4.30
### A Brief Tutorial ###
Here are some of the examples of di utility :
**1. The Default Output**
By default di command produces output in human readable format.
Here is an example :
$ di
Filesystem Mount Size Used Avail %Used fs Type
/dev/sda6 / 28.1G 20.2G 6.5G 77% ext4
udev /dev 1.5G 0.0G 1.5G 0% devtmpfs
tmpfs /run 300.2M 0.9M 299.3M 0% tmpfs
So you can see that the disk usage figures are displayed in gigabytes (G) and Megabytes(M). This is definitely better than the default output that df produces.
**2. Print All Fields Like Mount Points, Special Device Names etc Using A Option**
The option -A can be used to print mount points, special device names etc at full length.
Here is an example :
$ di -A
Mount fs Type Filesystem
Options
Size Used Free %Used %Free
Size Used Avail %Used %Free
Size Used Avail %Used
Inodes Iused Ifree %Iused
/ ext4 /dev/sda6
rw,errors=remount-ro
28.1G 20.2G 8.0G 72% 28%
28.1G 21.6G 6.5G 77% 23%
26.7G 20.2G 6.5G 75%
1884160 389881 1494279 21%
/dev devtmpfs udev
rw,mode=0755
1.5G 0.0G 1.5G 0% 100%
1.5G 0.0G 1.5G 0% 100%
1.5G 0.0G 1.5G 0%
381805 571 381234 0%
/run tmpfs tmpfs
rw,noexec,nosuid,size=10%,mode=0755
300.2M 0.9M 299.3M 0% 100%
300.2M 0.9M 299.3M 0% 100%
300.2M 0.9M 299.3M 0%
384191 549 383642 0%
So you can see that all the fields — that can also be used for debugging purposes — are printed in the output.
**3. Print All Mounted Devices Using -a Option**
Here is an example :
$ di -a
Filesystem Mount Size Used Avail %Used fs Type
/dev/sda6 / 28.1G 20.2G 6.5G 77% ext4
udev /dev 1.5G 0.0G 1.5G 0% devtmpfs
devpts /dev/pts 0.0M 0.0M 0.0M 0% devpts
proc /proc 0.0M 0.0M 0.0M 0% proc
binfmt_misc /proc/sys/fs/bi 0.0M 0.0M 0.0M 0% binfmt_misc
tmpfs /run 300.2M 0.9M 299.3M 0% tmpfs
none /run/lock 0.0M 0.0M 0.0M 0% tmpfs
none /run/shm 0.0M 0.0M 0.0M 0% tmpfs
none /run/user 0.0M 0.0M 0.0M 0% tmpfs
gvfsd-fuse /run/user/himan 0.0M 0.0M 0.0M 0% fuse.gvfsd-fuse
sysfs /sys 0.0M 0.0M 0.0M 0% sysfs
none /sys/fs/cgroup 0.0M 0.0M 0.0M 0% tmpfs
none /sys/fs/fuse/co 0.0M 0.0M 0.0M 0% fusectl
none /sys/kernel/deb 0.0M 0.0M 0.0M 0% debugfs
none /sys/kernel/sec 0.0M 0.0M 0.0M 0% securityfs
So you can see that all the information related to all the mounted devices was printed.
**4. Print Comma Separated Values Through -c Option**
The option -c can be used to print command separated values enclosed with double quotes.
Here is an example :
$ di -c
s,m,b,u,v,p,T
/dev/sda6,/,"28.1G","20.2G","6.5G",77%,ext4
udev,/dev,"1.5G","0.0G","1.5G",0%,devtmpfs
tmpfs,/run,"300.2M","0.9M","299.3M",0%,tmpfs
So you can see that the comma separated values were printed in the output.
**5. Print Size In Gigabytes Through -g Option**
Here is an example :
$ di -g
Filesystem Mount Gibis Used Avail %Used fs Type
/dev/sda6 / 28.1 20.2 6.5 77% ext4
udev /dev 1.5 0.0 1.5 0% devtmpfs
tmpfs /run 0.3 0.0 0.3 0% tmpfs
So you can see that all the size related values were printed in gigabytes.
Similarly you can use -k and -m options to display the size in kilobytes and megabytes respectively.
**6. Display Information Related To Specific File-system Type Through -I Option**
Suppose you want to display disk information related to only tmpfs filesystems. Here is how you can do it through -I option :
$ di -I tmpfs
Filesystem Mount Size Used Avail %Used fs Type
tmpfs /run 300.2M 0.9M 299.3M 0% tmpfs
none /run/lock 5.0M 0.0M 5.0M 0% tmpfs
none /run/shm 1.5G 0.0G 1.5G 0% tmpfs
none /run/user 100.0M 0.0M 100.0M 0% tmpfs
none /sys/fs/cgroup 0.0M 0.0M 0.0M 0% tmpfs
So you can see that information related to only tmpfs type file systems was displayed in the output.
**7. Skip The Header Line In Output Through -n Option**
If you are trying to parse the output of this command through a script (or a program) and want the di command to skip the display of header line then it can be made possible through -n option.
Here is an example :
$ di -n
/dev/sda6 / 28.1G 20.2G 6.5G 77% ext4
udev /dev 1.5G 0.0G 1.5G 0% devtmpfs
tmpfs /run 300.2M 0.9M 299.3M 0% tmpfs
So you can see that the header line was not displayed in the output.
**8. Print A Totals Line Below The List Of Filesystems Through -t Option**
If it is desired to display the totals of all the relevant columns, use -t option.
Here is an example :
$ di -t
Filesystem Mount Size Used Avail %Used fs Type
/dev/sda6 / 28.1G 20.2G 6.5G 77% ext4
udev /dev 1.5G 0.0G 1.5G 0% devtmpfs
tmpfs /run 300.2M 0.9M 299.3M 0% tmpfs
Total 29.9G 20.2G 8.3G 72%
Observe that the last row consists of the totals of values for all file systems.
**9. Sort The Output Through -s Option**
The option -s can be used to sort the output of this command.
Here is how you can reverse sort the output :
$ di -sr
Filesystem Mount Size Used Avail %Used fs Type
tmpfs /run 300.2M 0.9M 299.3M 0% tmpfs
udev /dev 1.5G 0.0G 1.5G 0% devtmpfs
/dev/sda6 / 28.1G 20.2G 6.5G 77% ext4
So you can use the sub-option r along with -s to reverse sort the output.
Similarly, you can do several other types of sorts using -s option. Here is an excerpt from the man page for your reference:
-s sort-type
Use sort-type to sort the output. The out
put of di is normally sorted by mount
point. The following sort flags may be
used to change the sort order: m by mount
point (default); n leave unsorted (as it
appears in the mount table); s by special
device name; t by filesystem type; r -
reverse the sort order.
These sort options may be combined in any
order. e.g.: di -stsrm by type, special,
reversed mount; di -strsrm by type,
reversed special, mount.
**10. Specify Output Format Strings Through -f Option**
You can specify the output format string through a combination of -f option and a sub-option.
For instance, to print the name of the mount point, use -fm.
Here is an example :
$ di -fm
Mount
/
/dev
/run
So you can see that only mount names were printed in the output.
Similarly, to print file system type, use -ft.
Here is an example :
$ di -ft
fsType
ext4
devtmpf
tmpfs
If you want to have a quick look then here is a snapshot of other formatting options available :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/di-1.png)
For complete set of options, refer to the [man page of di command][2].
### Download/Install ###
Here are some of the important links related to di command :
- [Home Page][3]
- [Download Link][4]
The command line utility di can also be downloaded and installed through command line by using apt, yum etc. Ubuntu users can download this command from Ubuntu Software Centre too.
### Pros ###
- Provides many advanced features
- OS independent
### Cons ###
- Does not come pre-installed on most of the Linux distributions
- Lots of option to learn
### Conclusion ###
To conclude, di command provides some very useful features over and above what df command provides. If you are looking for a df-like but advanced disk information related command line utility then di is the ideal choice. Try it out, it does what it promises.
**Have you ever tried di or any other df-like utility? Share your experience with us.**
--------------------------------------------------------------------------------
via: http://mylinuxbook.com/di-a-disk-information-utility/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://www.expertslogin.com/linux-command/linux-df-command/
[2]:http://www.manpagez.com/man/1/di/
[3]:http://www.gentoo.com/di/
[4]:http://freecode.com/projects/diskinfo

View File

@ -0,0 +1,133 @@
gcp Advanced Command Line File Copier Inspired By cp
================================================================================
A few weeks back, we discussed [advanced copy][1] (modified cp command that shows progress bar). A reader dropped in a comment pointing out another utility that also provides basic cp command functionality but along with some advanced features. So, in this article, lets discuss the very same command line utility — **gcp**.
### gcp Advanced Command Line File Copier ###
gcp — as the manual suggests — is an advanced command line file copier that is inspired by the standard [cp command][2] but provides various advanced features like progress bar indicator, source lists, continuous copying even if there is a problematic file etc.
Here is a complete list of options :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-main.png)
### Testing Environment ###
- OS Ubuntu 13.04
- Shell Bash 4.2.45
- Application gcp 0.1.3
### A Brief Tutorial ###
Here are some of the examples of gcp command :
**1. Transfer Progress Indicator**
The gcp command provides transfer progress indicator so that the user is aware of the current status of the copying process.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-1.png)
So you can see that the gcp command provides details like complete file size, percentage of copy complete, transfer rate and time left for the copy operation to complete.
**2. Copy Directories Recursively Through -r Option**
To copy complete directories recursively, use -r option.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-2.png)
So you can see that the gcp command shows the transfer indicator taking in account the complete size of the folder.
**3. Elaborate Error Descriptions**
In case of any error, the gcp command displays descriptive error messages pinning down the individual culprit file.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-3.png)
So you can see that the gcp command provided a detailed error message related to the file **August Rush.avi** that was already present inside the destination folder. But an error did not disrupt the copy of other file(s).
**4. Get Detailed Output Through -v Option**
The verbose option -v can be used to keep track of all the details that the gcp command is up to.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-4.png)
So you can see that extended details were provided in output when -v option was used.
**5. Create And Use Sources List**
One of the shining features of the gcp command is that it lets you create a list of source files that you can use later.
For example, I saved the list of source file in the following copy operation using the option **sources-save**.
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-5-1.png)
The list name in this case is **SOURCES_SAVE**. You can confirm the saved list through **sources-list** option.
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-5-3.png)
So you can see that a list named **SOURCES_SAVE** is saved.
Now, I deleted the files that I copied in the first step :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-5-2.png)
and repeated the first step again but without mentioning the source file names. The option **sources-load** was use to load the source file names from the list **SOURCES_SAVE**.
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-5-4.png)
So you can see that the gcp command picked up the source file names from the list **SOURCES_SAVE** and the copy process started normally.
Here are other options related to source file lists :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/gcp-5-5.png)
The gcp command provides various other useful options. For complete list of options, read the [man page of gcp][3].
### Download/Installation/Configuration ###
Here are some of the important links related to the gcp command :
- [Home Page][4]
- [Download Link][5]
- [Another useful gcp Tutorial][6]
You can alternatively download and install the gcp command through command line package managers like yum, apt-get etc. Ubuntu users can also use Ubuntu software centre to download and install this utility.
### Pros ###
- Status bar and source lists are the USP of this utility.
- Skips the problematic file(s) but the copy operation is not hampered.
- Usage is similar to that of the standard cp command.
### Cons ###
- While copying folders, it could be better if copy status of each file is displayed.
- Doesnt come pre-installed in most of the Linux distributions.
### Conclusion ###
If you are fed up of waiting blindly while copying large files through standard cp command the gcp is a good alternative. System administrators will love the source list feature. Its a must have utility.
**Have you ever used gcp or any other advanced cp-like command line utility? Share your experience with us.**
--------------------------------------------------------------------------------
via: http://mylinuxbook.com/gcp-advanced-command-line-file-copier-inspired-by-cp/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://mylinuxbook.com/advanced-copy-cp-command/
[2]:http://www.cyberciti.biz/faq/cp-copy-command-in-unix-examples/
[3]:http://manpages.ubuntu.com/manpages/precise/en/man1/gcp.1.html
[4]:http://wiki.goffi.org/wiki/Gcp/en
[5]:http://wiki.goffi.org/wiki/Gcp/en
[6]:http://www.hecticgeek.com/2012/03/gcp-command-line-file-copy-ubuntu-linux/

View File

@ -0,0 +1,117 @@
ncdu Ncurses Based Disk Usage Utility
================================================================================
uts a few days back, we discussed [gt5][1] (a graphical front-end to du). Continuing with this series of du alternatives, today we will discuss a ncurses based disk usage utility that can be run on a remote server set-up which does not have a graphical environment. The command line utility we are about to discuss is **ncdu**.
### ncdu Ncurses Based du Alternative ###
The command line utility ncdu is nothing but a curses based version of the standard du command. It helps to quickly view the disk usage statistics of a system even if there is no graphical environment installed on it.
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-main.png)
### Testing Environment ###
- OS Ubuntu 13.04
- Shell Bash 4.2.45
- Application ncdu 1.9
### A Brief Tutorial ###
Here are some of the examples of ncdu command :
**1. The Default Output**
Just execute the **ncdu** command and youll observe that first it scans the disk and then displays the disk usage of various directories in descending order.
Here is an example :
**> Scanning**
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-0.png)
**> Output**
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-1.png)
So you can see that a disk usage table is displayed in the output. If you want to scan complete file system, use the -x option with ncdu utility.
**2. Get More Information On Selected Directory By Pressing i**
As you can see that the first entry is selected by default. To know more details related to a selected entry, just press i.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-2.png)
So you can see that the information like Path, Type, Disk Usage, Apparent size etc. were displayed. To get rid of this window, just press i again.
**3. Delete A Directory From Within The ncdu Interface**
To delete a directory from within the ncdu interface, just select the entry and press d.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-3.png)
So you can see that ncdu asks for a confirmation from the user. If you press yes, the directory will be deleted from the system.
**4. Show Percentage Of Total Disk Consumption By Each Directory**
Press g to display percentage of total disk consumption by each directory.
Here is an example :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-4.png)
So you can see that percentage consumption of total disk for each entry is displayed in the second column of output.
**5. Get Help Regarding All The Available Hot Keys**
Press ? to get help related to hot keys, format information and ncdu version related information.
Here are some help snapshots :
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-5-1.png)
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-5-2.png)
![](http://mylinuxbook.com/wp-content/uploads/2013/10/ncdu-5-3.png)
For command line options and other information, go through the [man page of ncdu command][2].
### Download/Install/Configure ###
Here are some of the important links related to ncdu command :
- [Home Page][3]
- [Download Link][4]
Alternatively, ncdu can also be downloaded by command line managers like apt-get , yum etc. Additionally, Ubuntu users can use Ubuntu Software Centre to download this utility.
### Pros ###
- Quick access to a lot of information
- Light on resources
### Cons ###
- Doesnt come pre-installed on most of the Linux distributions
- Has a bit of learning curve associated with it.
### Conclusion ###
If you are not satisfied with the standard du command and are looking for a fast, ncurses based du-like utility then try out ncdu. It provides lots of customization options. Youll definitely like it.
**Have you ever used ncdu, gt5 or any other du-like utility? Share your experience with us.**
--------------------------------------------------------------------------------
via: http://mylinuxbook.com/ncdu-ncurses-based-disk-usage-utility/
译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[1]:http://mylinuxbook.com/gt5-a-graphical-alternative-to-du/
[2]:http://linux.die.net/man/1/ncdu
[3]:http://dev.yorhel.nl/ncdu
[4]:http://dev.yorhel.nl/ncdu