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 deskoutputs~/Desktopand that your current directory contains a folderfooand a filebar.txt
-
jmv foo deskwill move the folderfooto your Desktop and move your position to your Desktop -
jmv bar.txt deskwill move the filebar.txtto your Desktop and move your position to your Desktop -
jmv foo bar.txt deskwill move the folderfooand the filebar.txtto your Desktop and move your position to your Desktop -
jmv -nocd foo bar.txt deskwill move the folderfooand the filebar.txtto your Desktop but won't change your current position
Note :
jmvdoes 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 deskoutputs~/Desktopand that your current directory contains a folderfooand a filebar.txt
-
ljandlj .outputsfoo bar.txt(same output aslsorls .) -
lj foowill display the content of the directoryfoo(same asls foo) -
lj deskwill display the content of your Desktop (same asls ~/Desktop)
All these commands also work if you add ls options to lj.
Example :
-
lj -lia deskis equivalent tols -lia ~/Desktop -
lj -lia foois equivalent tols -lia foo
If you want
lsto work by default asljyou can add this alias in your rc file (~/.bashrc,~/.zshrc,~/.aliasesetc) :alias ls='lj'
If you have any suggestions or unexpected behaviour, feel free to create an issue :)