My favorite aliases
Nov. 13th, 2019 12:42 pm Yep, still dinking around with Windows 10, which I am liking better and better the more I get to know it.
I am still unreasonably tickled to have access to Linux and bash, and am starting to remember some of the things I used to do with it. Really, Linux is all about files. Linux essentially sees the world as a bunch of files, including all forms of I/O. And who can't use some low level tools for file management?
I was chatting with someone at the Minnstf meeting who maintained that LInux over Windows did not have direct access to Windows files. Maybe it didn't with Cygwin, but Ubuntu over Win10 definitely does. Your C Drive is at /mnt/c. Can't get much simpler than that, right?
I found a trove of my old work scripts and aliases and used them to customize my bash login. I was crazy for aliases, starting with quick ways of positioning and viewing the file system. I'm still relearning the syntax and can't quite remember why some of these are so complicated, but I'm sure there is a reason. Anyway, here are a few of my favorites, revised to reflect my local filesystem.
I am still unreasonably tickled to have access to Linux and bash, and am starting to remember some of the things I used to do with it. Really, Linux is all about files. Linux essentially sees the world as a bunch of files, including all forms of I/O. And who can't use some low level tools for file management?
I was chatting with someone at the Minnstf meeting who maintained that LInux over Windows did not have direct access to Windows files. Maybe it didn't with Cygwin, but Ubuntu over Win10 definitely does. Your C Drive is at /mnt/c. Can't get much simpler than that, right?
I found a trove of my old work scripts and aliases and used them to customize my bash login. I was crazy for aliases, starting with quick ways of positioning and viewing the file system. I'm still relearning the syntax and can't quite remember why some of these are so complicated, but I'm sure there is a reason. Anyway, here are a few of my favorites, revised to reflect my local filesystem.
### Positioning
alias cdh="cd $HOME; pwd; ls"
alias cdw="cd /mnt/c; pwd; ls"
alias cds="cd /mnt/c/Users/sharon; pwd; ls"
alias cdf="cd /mnt/c/Users/sharon/OneDrive/Documents/FILES; pwd; ls"
alias cdsw="cd /mnt/c/Users/sharon/OneDrive/Documents/FILES/1SharonWork; pwd; ls"
## Self-referential
alias va="vim $HOME/.alias"
alias sa="source $HOME/.alias"
## Network Names
## External DNS server addresses found on router
RTR="10.1.1.1"
DNS1="206.55.176.53"
DNS2="216.17.8.138"
### COMMANDS
alias p3="ping -c 3 "
## MY OLD ALIASES
alias dus="du | sort -n"
alias lsd="pwd; echo '========================'; ls -lc | egrep '^d|^l'"
alias lsdot="pwd; echo '========================'; ls -ld .*"
alias lsf="pwd; echo '========================'; ls -lrt | grep '\-r'"
alias lsa="pwd; echo '========================'; ls -alrt | more"
alias lss="pwd; echo '========================'; ls -lrt | sort +3 -n -r"
alias lslink="pwd; echo '========================'; ls -lc | grep '\^l'"
How about you (you few Linux heads that are reading this). What are your favorite aliases?
How about you (you few Linux heads that are reading this). What are your favorite aliases?
no subject
Date: 2019-11-13 09:33 pm (UTC)(grep-find is a bash version of emacs' M-Xgrep-find)
There's another batch that cd to various locations in my git working trees; these are the ones I use for posting and to-do data mining:
no subject
Date: 2019-11-13 10:13 pm (UTC)Which, I presume, is the emacs version of grep?
no subject
Date: 2019-11-13 11:24 pm (UTC)find . -type f -exec grep -nH "$@" {} +
Where "$@" expands to whatever you passed on the command line, with each argument quoted separately. So you can use, e.g.
grep-find -i "some phrase"
for a case-insensitive search. The advantage of doing it in emacs is that it has a command to go to the next match. The disadvantage is that sometimes you don't need to do that, and want to pipe the result into something else. Like wc.
I should have mentioned that all of the generic ones are on github, in
Honu/_bashrc at master ยท ssavitzky/Honu
Have I blogged about that yet? I think so... *rummage* Oh yes,
https://mdlbear.dreamwidth.org/1688029.html
A bit sketchy, though.