aboutsummaryrefslogtreecommitdiff
path: root/conf.d/03linux.fish
blob: 9822da441b9083fd9bea9dd3b1645c2aac3265bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
if status is-interactive; and string match -q -e 'Linux' (uname)

if command -sq dircolors; and test -f ~/.config/dircolors
  eval (dircolors -c ~/.config/dircolors)
end

alias ls 'ls --color=auto -F'
alias la 'ls --color=auto -F -a'
alias ll 'ls --color=auto -F -l'
alias lla 'ls --color=auto -F -l -a'

alias grep 'grep --color=auto'
alias diff 'diff --color=auto'

alias ff 'find . -type f -name'
alias fd 'find . -type d -name'
alias fbs 'find . -xtype l'

alias who 'who -H -w -u'

alias free 'free -h'
alias df 'df -Th'
alias ps 'ps -ejH'
alias lsof 'lsfd'

# If we have iproute2
if command -sq ip
  alias ip "ip -c"
  alias sockstat "ss -4 -6 -l -r -p"

  alias_if_not route ip route
  alias_if_not ifconfig ip link
  alias_if_not netstat ss -4 -6 -l -r -p
end

# If we have systemd
if command -sq systemctl
  alias pss "systemd-cgls"
  alias ipconfig "networkctl -a status"

  if not fish_is_root_user
    alias showdnscache "sudo resolvectl show-cache"
    alias cleardnscache "sudo resolvectl flush-caches"
  else
    alias showdnscache "resolvectl show-cache"
    alias cleardnscache "resolvectl flush-caches"
  end

  alias_if_not nslookup systemd-resolve
end

end