issue92:labo_linux_2
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue92:labo_linux_2 [2015/01/07 16:13] – créée andre_domenech | issue92:labo_linux_2 [2015/03/05 18:58] (Version actuelle) – [5] auntiee | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | SSH is awesome. Tools like Midnight Commander (mc) are also really handy. Sadly, I’m a bit of a lazy admin and like to do some tasks graphically. A few days ago, I found that I needed to add text to the filename of a bunch of movies on my XBMC machine. I could have connected a keyboard and mouse to the machine (only an infrared receiver is connected to the USB port), logged out of the XBMC account, logged in to the openbox interface, and started renaming files, but I found a nice graphical tool to batch rename files. I just needed to figure a way to remotely mount the movie folder on our XBMC machine. | + | ====== 1 ====== |
+ | |||
+ | **SSH is awesome. Tools like Midnight Commander (mc) are also really handy. Sadly, I’m a bit of a lazy admin and like to do some tasks graphically. A few days ago, I found that I needed to add text to the filename of a bunch of movies on my XBMC machine. I could have connected a keyboard and mouse to the machine (only an infrared receiver is connected to the USB port), logged out of the XBMC account, logged in to the openbox interface, and started renaming files, but I found a nice graphical tool to batch rename files. I just needed to figure a way to remotely mount the movie folder on our XBMC machine. | ||
The answer was the sshfs package. I use Xubuntu on most of my systems, and sshfs is not installed by default. Installing software is one job I prefer doing from the terminal, it’s just quicker: | The answer was the sshfs package. I use Xubuntu on most of my systems, and sshfs is not installed by default. Installing software is one job I prefer doing from the terminal, it’s just quicker: | ||
Ligne 6: | Ligne 8: | ||
Mounting a remote partition is easy once sshfs is installed. But first I’ll make a directory to work from: | Mounting a remote partition is easy once sshfs is installed. But first I’ll make a directory to work from: | ||
+ | |||
+ | mkdir ~/sftp** | ||
+ | |||
+ | SSH est génial. Des outils tels que Midnight Commander (mc) sont également très pratiques. Malheureusement, | ||
+ | |||
+ | La réponse a été le paquet sshfs. J' | ||
+ | |||
+ | sudo apt-get install sshfs | ||
+ | |||
+ | Monter une partition distante est facile une fois sshfs installé. Mais d' | ||
mkdir ~/sftp | mkdir ~/sftp | ||
- | Now we’ll mount the remote file system. In this example, I’m going to use xbmc for the username on my XBMC remote server (which is called xbmc), and charles as my username on my local machine. Replace xbmc and charles with whatever username you use. | + | ====== 2 ====== |
+ | |||
+ | **Now we’ll mount the remote file system. In this example, I’m going to use xbmc for the username on my XBMC remote server (which is called xbmc), and charles as my username on my local machine. Replace xbmc and charles with whatever username you use. | ||
sshfs xbmc@xbmc:/ | sshfs xbmc@xbmc:/ | ||
Notice that you do not have to sudo to mount the remote file system. You will, however, have to know the password for the user on the remote system. In this example, we mount the remote / | Notice that you do not have to sudo to mount the remote file system. You will, however, have to know the password for the user on the remote system. In this example, we mount the remote / | ||
+ | |||
+ | ssfs xbmc@192.168.1.10:/ | ||
+ | |||
+ | Maintenant, nous allons monter le système de fichiers distant. Dans cet exemple, je vais utiliser xbmc comme nom d' | ||
+ | |||
+ | sshfs xbmc@xbmc:/ | ||
+ | |||
+ | Notez que vous n'avez pas besoin de sudo pour monter le système de fichiers distant. Cependant, vous aurez besoin de connaître le mot de passe de l' | ||
ssfs xbmc@192.168.1.10:/ | ssfs xbmc@192.168.1.10:/ | ||
- | Now that we have the remote system mounted, we need a program to rename the files. Of course you can do this with mv and regular expressions, | + | ====== 3 ====== |
+ | |||
+ | **Now that we have the remote system mounted, we need a program to rename the files. Of course you can do this with mv and regular expressions, | ||
One of the great features of gprename is the ability to preview your changes. I always preview changes in case I’ve messed up which letter/ | One of the great features of gprename is the ability to preview your changes. I always preview changes in case I’ve messed up which letter/ | ||
- | In the screenshot example, below, I started with the idea that I would replace the small and in Harry Potter and the … with a capital And, but after previewing I noticed that I should also capitalize the T in The – so the filename matches with the rest of the Harry Potter series. I made the change and previewed again before I clicked the Rename button. | + | In the screenshot example, below, I started with the idea that I would replace the small and in Harry Potter and the … with a capital And, but after previewing I noticed that I should also capitalize the T in The – so the filename matches with the rest of the Harry Potter series. I made the change and previewed again before I clicked the Rename button.** |
- | Renaming is just one of the functions you can do with GPRename. Sometimes it’s nice to add or strip out text. I’ve started to differentiate some of my media by adding the text DVD or Blueray to the end of the file. Just switch to the Insert/ | + | Maintenant que nous avons monté le système distant, nous avons besoin d'un programme pour renommer les fichiers. Bien sûr, vous pouvez le faire avec mv et des expressions régulières, mais je trouve que j'ai une mauvaise habitude de me mélanger et d' |
- | If you have lots of files with text in the same spot that you want to get rid of, you can select the delete option and choose which positions to delete between. For example, if you have a bunch of music files that begin 1. song_name.mp3, 2. songname.mp3, | + | Une des caractéristiques géniales de gprename est la possibilité de prévisualiser vos modifications. Je prévisualise toujours mes modifications au cas où j'ai foiré quelle lettre/ |
- | Once you’re done, don’t forget to close gprename – or sshfs might not be able to unmount the filesystem. You cannot simply umount ~/sftp. | + | Dans l' |
+ | |||
+ | ====== 4 ====== | ||
+ | |||
+ | **Renaming is just one of the functions you can do with GPRename. Sometimes it’s nice to add or strip out text. I’ve started to differentiate some of my media by adding the text DVD or Blueray to the end of the file. Just switch to the Insert/ | ||
+ | |||
+ | If you have lots of files with text in the same spot that you want to get rid of, you can select the delete option and choose which positions to delete between. For example, if you have a bunch of music files that begin 1. song_name.mp3, | ||
+ | |||
+ | Renommer est juste l'une des fonctionnalités de GPRename. Parfois, on souhaite ajouter ou retirer du texte. J'ai commencé à différencier certains de mes médias en ajoutant le texte « DVD » ou « Blueray » à la fin du fichier. Il suffit de passer à l' | ||
+ | |||
+ | Si vous avez beaucoup de fichiers avec du texte dont vous voulez vous débarrasser au même endroit, vous pouvez sélectionner l' | ||
+ | |||
+ | ====== 5 ====== | ||
+ | |||
+ | **Once you’re done, don’t forget to close gprename – or sshfs might not be able to unmount the filesystem. You cannot simply umount ~/sftp. | ||
SSHfs uses fuse to mount the file system. To unmount ~/sftp use: | SSHfs uses fuse to mount the file system. To unmount ~/sftp use: | ||
Ligne 35: | Ligne 73: | ||
Again you do not need to sudo because you’re mounting on your own home directory. | Again you do not need to sudo because you’re mounting on your own home directory. | ||
- | GPrename also works with directories. Regular expressions are more handy, but if you haven’t learned regexp, or are worried about messing up your files, use gprename and preview before you rename. | + | GPrename also works with directories. Regular expressions are more handy, but if you haven’t learned regexp, or are worried about messing up your files, use gprename and preview before you rename.** |
+ | |||
+ | Une fois que vous aurez terminé, n' | ||
+ | |||
+ | SSHfs utilise fuse pour monter le système de fichier. Pour démonter ~/sftp, utilisez : | ||
+ | |||
+ | fusermount -u ~/sftp | ||
+ | |||
+ | Encore une fois, vous n'avez pas besoin de sudo parce que vous faites le montage sur votre répertoire personnel. | ||
+ | |||
+ | GPrename fonctionne également avec les répertoires. Les expressions régulières sont plus pratiques, mais si vous n'avez pas appris les regexp, ou craignez de mettre le bazar dans vos fichiers, utilisez gprename et la prévisualisation avant de renommer. |
issue92/labo_linux_2.1420643583.txt.gz · Dernière modification : 2015/01/07 16:13 de andre_domenech