Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
se7enOffline
Post subject: terminal tricks  PostPosted: 08.10.2010, 07:28



Joined: 2010-09-11
Posts: 164

Status: Offline
Fast and easy navigating between folder.

I love to use the cli and I never really got used to mc. But moving between folder/with/many/subfolder/ can be a bit time consuming. Here are two commands that might help you to do things faster.

1. 'command !$' which uses the path from your last command
2. 'cd -' which lets you jump between two folder

#create a folder with subfolder

      Code:
se7en@toshibox:~$ mkdir -p easy/to/navigate/
mkdir: created directory `easy'
mkdir: created directory `easy/to'
mkdir: created directory `easy/to/navigate/'


# move to the directory with 'cd !$' ('any_command !$' is possible)

      Code:
se7en@toshibox:~$ cd !$   #instead of cd easy/to/navigate/
cd easy/to/navigate/
se7en@toshibox:~/easy/to/navigate$


#now change to another directory

      Code:
se7en@toshibox:~/easy/to/navigate$cd /media/disk1part4/
se7en@toshibox:/media/disk1part4$


#use the 'cd -' command to fast switch between the two directories

      Code:
se7en@toshibox:/media/disk1part4$ cd -   #instead of cd /home/se7en/easy/to/navigate/
/home/se7en/easy/to/navigate


#and move back

      Code:
se7en@toshibox:~/easy/to/navigate$ cd -   #instead of cd /media/disk1part4
/media/disk1part4
se7en@toshibox:/media/disk1part4$
 
 View user's profile Send private message  
Reply with quote Back to top
Sprinter1Offline
Post subject: RE: terminal tricks  PostPosted: 08.10.2010, 07:45



Joined: 2010-09-13
Posts: 17
Location: Hamburg
Status: Offline
that's cool! Thx

Sprinter
 
 View user's profile Send private message  
Reply with quote Back to top
muchan
Post subject: RE: terminal tricks  PostPosted: 08.10.2010, 08:55
Moderator


Joined: 2010-09-11
Posts: 468

      Quote:

I love to use the cli and I never really got used to mc. But moving between folder/with/many/subfolder/ can be a bit time consuming.


I'd suggest you trying zsh for command shell for a while.
It has strong set of cd comamnds. Search web about zsh and read some
to get the feel about zsh. (I use both zsh and bash, case by case)
 
 View user's profile Send private message  
Reply with quote Back to top
se7enOffline
Post subject:   PostPosted: 08.10.2010, 09:14



Joined: 2010-09-11
Posts: 164

Status: Offline
I did never use zsh because I work on many different Linux systems and bash is always installed.
But thanks I will have a look into zsh.

I was hoping other people have some other tricks to post here.
 
 View user's profile Send private message  
Reply with quote Back to top
DonKultOffline
Post subject:   PostPosted: 08.10.2010, 09:32
Team Member


Joined: 2010-09-02
Posts: 481

Status: Offline
You might want to have a look at the bash-builtins pushd and popd ( use 'help' command, they have no manpages!).

xd can be interesting, too.

_________________
MfG. DonKult
"I never make stupid mistakes. Only very, very clever ones." ~ The Doctor
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 12 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by Zafenio