Re implementation of some basic commands (ls, mv, cp) with autojump
For this command to work, you need to have autojump installed.
To use these functions, you need to clone the repo and add this line to your ~/.bashrc
of ~/.zshrc
file :
source PATH/TO/FILE/cmds.sh
The jmv
command allows you to move a file or a folder to a destination specified using autojump.
jmv
will also move your current position to the destination.
This can be disabled by using the option -nocd
.
Example :
Assuming
autojump desk
outputs~/Desktop
and that your current directory contains a folderfoo
and a filebar.txt
-
jmv foo desk
will move the folderfoo
to your Desktop and move your position to your Desktop -
jmv bar.txt desk
will move the filebar.txt
to your Desktop and move your position to your Desktop -
jmv foo bar.txt desk
will move the folderfoo
and the filebar.txt
to your Desktop and move your position to your Desktop -
jmv -nocd foo bar.txt desk
will move the folderfoo
and the filebar.txt
to your Desktop but won't change your current position
Note :
jmv
does not support yet the options ofmv
The behaviour of lj
is the same as ls
, except when the last argument is not an existing destination/path.
Example :
Assuming
autojump desk
outputs~/Desktop
and that your current directory contains a folderfoo
and a filebar.txt
-
lj
andlj .
outputsfoo bar.txt
(same output asls
orls .
) -
lj foo
will display the content of the directoryfoo
(same asls foo
) -
lj desk
will display the content of your Desktop (same asls ~/Desktop
)
All these commands also work if you add ls
options to lj
.
Example :
-
lj -lia desk
is equivalent tols -lia ~/Desktop
-
lj -lia foo
is equivalent tols -lia foo
If you want
ls
to work by default aslj
you can add this alias in your rc file (~/.bashrc
,~/.zshrc
,~/.aliases
etc) :alias ls='lj'
If you have any suggestions or unexpected behaviour, feel free to create an issue :)