There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

Anyone else adding "verbose", "interactive" and "recursive" to basic file commands?

As a person raised by GUIs, an extra visual confirmation and an extra prompt is a nice touch. I also like when the system says “Oh, is that a directory? No problem, I’ll give you the usual treatment.” You know what I mean?

<pre style="background-color:#ffffff;">
<span style="color:#323232;">alias ls='ls --group-directories-first --color=auto -w 120'
</span><span style="color:#323232;">alias ll='exa --group-directories-first -l'
</span><span style="color:#323232;">alias la='ll -a'
</span><span style="color:#323232;">alias lt='ll --tree'
</span><span style="color:#323232;">
</span><span style="color:#323232;">alias cp='cp --recursive --interactive --verbose --reflink=always'
</span><span style="color:#323232;">alias mv='mv --interactive --verbose'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># custom pwd
</span><span style="color:#323232;"># - replace $HOME with ~
</span><span style="color:#323232;"># - make everything before the last '/' green, and everything after white and bold
</span><span style="color:#323232;"># - alias to p
</span><span style="color:#323232;">alias pwd="pwd | sed 's:$HOME:~:' | sed -E 's:(.*/)([^/]+):x1b[32m1x1b[0mx1b[1m2x1b[0m:'"
</span><span style="color:#323232;">alias p="pwd"
</span><span style="color:#323232;">
</span><span style="color:#323232;"># custom cd.
</span><span style="color:#323232;"># - prints the new directory after cd'ing.
</span><span style="color:#323232;">cd () { 
</span><span style="color:#323232;">    command cd "$@" && p;
</span><span style="color:#323232;">}
</span><span style="color:#323232;">alias c="cd"
</span><span style="color:#323232;">alias '..'='c ..'
</span><span style="color:#323232;">alias '...'='c ../..'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># For the '~' alias, we want to use the original cd because printing '~'
</span><span style="color:#323232;"># again would be redundant.
</span><span style="color:#323232;">alias '~'='command cd'
</span><span style="color:#323232;">
</span><span style="color:#323232;"># custom rm.
</span><span style="color:#323232;"># adds a '-r' flag only if there is a single argument and that argument
</span><span style="color:#323232;"># is a directory.
</span><span style="color:#323232;"># This is because I want the behavior of -I (interactive) to be the default,
</span><span style="color:#323232;"># but I also want to have the -r flag available when I need it without being
</span><span style="color:#323232;"># prompted for single files.
</span><span style="color:#323232;">function rm () { 
</span><span style="color:#323232;">  if [ $# -eq 1 ] && [ -d "$1" ]; then
</span><span style="color:#323232;">    rm --verbose --interactive=once --recursive "$1";
</span><span style="color:#323232;">  else
</span><span style="color:#323232;">    rm --verbose --interactive=once "$@";
</span><span style="color:#323232;">  fi;
</span><span style="color:#323232;">}
</span><span style="color:#323232;">
</span><span style="color:#323232;"># mkdir + cd (created as a function because they run on the current shell,
</span><span style="color:#323232;"># which is what we want for cd)
</span><span style="color:#323232;">mc () { 
</span><span style="color:#323232;">  mkdir -p -- "$1" && cd -P -- "$1";
</span><span style="color:#323232;">}
</span>
  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines