感谢支持
我们一直在努力

在Linux下用命令行中玩转音乐库

Linux下的命令行可能是对于新手而言最恐怖的经历了。我记得花费若干小时来尝试搞明白终端爆出的错误信息。当然,这是完全值得的!如果现在让我只能挑一个让新手学习学习命令行的原因,那可能就是用命令行来整个管理音乐库。在这个事情上,我喜欢用的软件叫做cmus,是”C* MUsic Player”(C音乐播放器)的简写,它完全由C写成。

cmus是一个内置了音频播放器的强大的音乐文件管理器。用它的基于ncurses的命令行界面,你可以浏览你的音乐库,并从播放列表或队列中播放音乐,这一切都是在命令行下。

Linux上安装cmus

首先,你需要按照如下建议设置并安装cmus。

在Ubuntu, Debian 或者Linux Mint中:

  1. $ sudo aptget install cmus

在Fedora上,首先启用RPM Fusion仓库,接着运行:

  1. $ sudo yum install cmus

在CentOS上,首先启用Repoforge仓库,接着运行:

  1. $ sudo yum install cmus

在Archlinux上:

  1. $ sudo pacman S cmus

安装完之后,在命令行下如下输入就可运行cums:

  1. $ cmus

导入音乐文件到 cmus

第一件要做的事情是导入你的音乐文件到你的库中。这个过程可以看出两个事情:快捷方式受到了vim的命令模式的启发;还有cmus运行的很快。我已经在20秒之内成功地导入了超过1000首歌!而在iTunes或者其他任何图形音乐库软件下试一下导入,我想你会有足够的时间来做一份花生酱三明治 :>。

要在cmus下面导入音乐,输入下面的像vim一样的命令。

  1. :a /path/to/your/music/folder

在我的Xubuntu上,我这么做:

  1. :a /home/adrien/Music/

接下来这个目录下所有的音乐文件会立马按照艺术家或者专辑的方式排列显示。

快速入门

在开始前,你可能希望记住一些基本快捷方式来开始播放你的音乐。这是cmus的唯一缺点。除非你改变它们,否则默认的快捷方式并不直观,并且你不得不学习它们。简而言之:

  • x 播放或重播音乐
  • c 暂停
  • b 播放下一首音乐
  • z 播放前一首音乐
  • s 激活随机播放

记住之后,我们就准备开始了!

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/102051.htm

How to set up RPMforge (now called Repoforge) repository on CentOS

Repoforge, previously known as RPMforge, maintains a repository of RPM packages for Red Hat Enterprise Linux (RHEL), CentOS and Scientific Linux. If you are a RHEL or CentOS user, I strongly suggest you set up Repoforge repository on your system, as it contains many useful software packages that are not available in existing stock repositories.

In order to set up Repoforge repository on CentOS, you first need to know the version of your CentOS as well as the underlying process architecture.

To find out which release version of CentOS you are using:

$ cat /etc/RedHat-release

CentOS release 6.3 (Final)

To check whether your CentOS is 32-bit (i.e., i686) or 64-bit (i.e., x86_64) based:

$ uname -a

Linux centos.domain 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

Now that you know enough about your CentOS system, let’s go ahead and install RPMforge on CentOS.

For 32-bit CentOS 6.*:

$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm

 


 

For 64-bit CentOS 6.*:

$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm

 

For 32-bit CentOS 5.*:

$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.i386.rpm

 

For 64-bit CentOS 5.*:

$ sudo rpm -Uvh http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el5.rf.x86_64.rpm

 

Once RPMforge is installed on your system, you can use yum to install all available packages from the Repoforge repo.

How to install RPM Fusion on Fedora or CentOS

RPM Fusion is a software repository that offers various free or non-free add-on packages that do not ship with the original Fedora distribution. RPM Fusion contains various useful packages that are not included in the Fedora distribution just because they do not meet Fedora’s free software requirements.

In this post, I will explain how to set up RPM Fusion repository on Fedora or CentOS.

Once RPM Fusion is enabled on your system, you can install any package available from the repository simply by using yum command.

First of all, to check whether or not RPM Fusion is installed on your system, run the following command.

$ yum repolist | grep rpmfusion

 

If the above command does not produce any result, it means that RPM Fusion is not installed on your system.

RPM Fusion maintains two separate repositories for free and non-free packages. You can selectively enable either or both repositories as you want.

Set up RPM Fusion on Fedora

The following instruction works for Fedora 14 or higher.


To enable the free repository of RPM Fusion:
$ sudo yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm

 

To enable the non-free repository of RPM Fusion:

$ sudo yum localinstall –nogpgcheck http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

 

Set up RPM Fusion on CentOS

In order to install RPM fusion on CentOS, you first need to enable EPEL repository first. After that, proceed as follows to set up RPM Fusion on CentOS.

To enable the free/non-free repositories of RPM Fusion on CentOS 6:

$ sudo yum localinstall –nogpgcheck http://download1.rpmfusion.org/free/el/updates/6/i386/rpmfusion-free-release-6-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/6/i386/rpmfusion-nonfree-release-6-1.noarch.rpm

 

To enable the free/non-free repositories of RPM Fusion on CentOS 5:

$ sudo rpm -Uvh http://download1.rpmfusion.org/free/el/updates/5/i386/rpmfusion-free-release-5-1.noarch.rpm http://download1.rpmfusion.org/nonfree/el/updates/5/i386/rpmfusion-nonfree-release-5-1.noarch.rpm

赞(0) 打赏
转载请注明出处:服务器评测 » 在Linux下用命令行中玩转音乐库
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏