Modern Command Alternatives

There are plenty of useful and must know commands as pointed out in the previous article; Must know Linux commands.
Here I will give you some modern alternatives to those commands.

ls & tree

My current recommendation is called lsd (lsdelux) and I use it in conjunction with vivid to change the colour scheme of ls. lsd provides a much nicer interface and gives you a fully customisable ls command. Bellow I have listed my recommended aliases for lsd.

		  
## LSD ## https://github.com/lsd-rs/lsd
alias ls="lsd -a"
alias ll="lsd -lah"
alias tree="lsd --tree"
		  
		  

https://github.com/lsd-rs/lsd
https://github.com/sharkdp/vivid

cd

zoxide is a smarter cd command written in the much loved rust language, it is inspired by z and autojump. It works by building up a library of where you have been using your cd command, once you have been there you can jump to that directory from anywhere and you don't even have to remember exactly where it is or what its called.

		  
z foo              # cd into highest ranked directory matching foo
z foo bar          # cd into highest ranked directory matching foo and bar
z foo /            # cd into a subdirectory starting with foo

z ~/foo            # z also works like a regular cd command
z foo/             # cd into relative path
z ..               # cd one level up
z -                # cd into previous directory

zi foo             # cd with interactive selection (using fzf)

z foo  # show interactive completions (zoxide v0.8.0+, bash 4.4+/fish/zsh only)
		  
		  

https://github.com/ajeetdsouza/zoxide

mkdir

This next one is not a new program but rather a function that you must place in your rc file (.bashrc, .zshrc, etc.) It is called "mkcd". mkcd will create a new directory and jump into it immediately, this is much faster than the alternative of "mkdir foo" then "cd foo".

		  
# mkcd
function mkcd {
  if [ ! -n "$1" ]; then
    echo "Enter a directory name"
  elif [ -d $1 ]; then
    echo "\`$1' already exists"
  else
    mkdir $1 && cd $1
  fi
}
		  
		  

find

fd is one of the best alternatives to the find command, it is so good that I had actually forgot it isn't the default. It is very fast, simple, powerful and written in rust.


https://github.com/sharkdp/fd

cat

bat is a great alternative to cat, it supports syntax highlighting and will always start you at the top of a file. bat has integrations with git, fzf, ripgrep, fd and many more.


https://github.com/sharkdp/bat

grep

ripgrep is a line-oriented search tool that recursively searches the current directory for a regex pattern. Put more simply it will search files for a given search term and then tell you what file and what line number it is on. It is miles faster and much more user friendly than grep, not to mention written in rust.


https://github.com/BurntSushi/ripgrep