一堆eps文件要将每个文件单独压缩成一个文件,比如a.eps , b.eps, c.eps 压缩成 a.zip ,b.zip ,c.zip for…
Linux: 让切换目录更方便: pushd,popd,dirs,cd –
一,为何要使用这几个命令?
二, 如何在两个目录之间切换?
[root@localhost ~]# cd /usr/share/kde4/apps/kget/pics/ [root@localhost pics]# cd - /root [root@localhost ~]# cd - /usr/share/kde4/apps/kget/pics [root@localhost pics]#
[root@localhost ~]# cd /usr/share/kde4/apps/kget/pics/ [root@localhost pics]# echo $OLDPWD; /root [root@localhost pics]# cd $OLDPWD [root@localhost ~]# echo $OLDPWD; /usr/share/kde4/apps/kget/pics [root@localhost ~]# cd $OLDPWD; [root@localhost pics]# echo $OLDPWD; /root
三, 如何在多个目录之间切换?
[root@localhost ~]# pushd /usr/local/sbin/ /usr/local/sbin ~ [root@localhost sbin]# dirs /usr/local/sbin ~ [root@localhost sbin]# dirs -p -v 0 /usr/local/sbin 1 ~ [root@localhost sbin]# pushd /usr/share/kde4/apps/kget/ /usr/share/kde4/apps/kget /usr/local/sbin ~ [root@localhost kget]# dirs -p -v 0 /usr/share/kde4/apps/kget 1 /usr/local/sbin 2 ~
[root@localhost kget]# pushd /boot/grub/ /boot/grub /usr/share/kde4/apps/kget /usr/local/sbin ~ [root@localhost grub]# dirs -v 0 /boot/grub 1 /usr/share/kde4/apps/kget 2 /usr/local/sbin 3 ~ [root@localhost grub]# pushd /usr/share/kde4/apps/kget /boot/grub /usr/local/sbin ~ [root@localhost kget]# dirs -v 0 /usr/share/kde4/apps/kget 1 /boot/grub 2 /usr/local/sbin 3 ~ [root@localhost kget]# pushd /boot/grub /usr/share/kde4/apps/kget /usr/local/sbin ~ [root@localhost grub]# dirs -v 0 /boot/grub 1 /usr/share/kde4/apps/kget 2 /usr/local/sbin 3 ~
[root@localhost grub]# dirs -v 0 /boot/grub 1 /usr/share/kde4/apps/kget 2 /usr/local/sbin 3 ~ [root@localhost grub]# pushd +2 /usr/local/sbin ~ /boot/grub /usr/share/kde4/apps/kget [root@localhost sbin]# dirs -v 0 /usr/local/sbin 1 ~ 2 /boot/grub 3 /usr/share/kde4/apps/kget
[root@localhost sbin]# dirs -v 0 /usr/local/sbin 1 ~ 2 /boot/grub 3 /usr/share/kde4/apps/kget [root@localhost sbin]# popd ~ /boot/grub /usr/share/kde4/apps/kget [root@localhost ~]# dirs -v 0 ~ 1 /boot/grub 2 /usr/share/kde4/apps/kget [root@localhost ~]# popd +1 ~ /usr/share/kde4/apps/kget [root@localhost ~]# dirs -v 0 ~ 1 /usr/share/kde4/apps/kget
四,多学一点知识
[root@localhost ~]# dirs -v 0 ~ 1 /usr/share/kde4/apps/kget [root@localhost ~]# pushd -n /boot/grub ~ /boot/grub /usr/share/kde4/apps/kget [root@localhost ~]# dirs -v 0 ~ 1 /boot/grub 2 /usr/share/kde4/apps/kget
[root@localhost ~]# dirs -v 0 ~ 1 /boot/grub 2 /usr/share/kde4/apps/kget [root@localhost ~]# dirs -c [root@localhost ~]# dirs -v 0 ~
原文:http://www.cnblogs.com/zhengyuxin/articles/1933920.html
本文:Linux: 让切换目录更方便: pushd,popd,dirs,cd –