Linux-Daily-Tricks

Tips - Linux daily Tricks

These are some tips and tricks I usually need in my daily work, so I tried to document them here.

Table of Tricks

To delete file content in vi

# Enter the script
vi <script-name>

# to get to the first line in the file.
gg 

# to enter visualize mode.
v 

# to select all.
G 

# delete.
dd 

To search for Something

find / -name <target-dir-to-find> 2>/dev/null

To get OS info you are using:

uname -a

To know Which Shell you Use

echo $0

To get OS version

cat /etc/os-release

To identify root dir

findmnt / -o source -n

tmux Use mouse to scroll

# To use your mouse in this mode (called copy mode) press ^b + : and enter following:

setw -g mouse on

Reference: Scroll shell output with mouse in tmux. https://superuser.com/a/217269

To Update Nvidia Driver

dpkg -l | grep nvidia

sudo apt-get --purge remove nvidia*

sudo apt-get --purge remove "*nvidia*"

sudo apt autoremove

sudo apt autoclean

sudo reboot
  • Then use the default linux nvidia driver supported.

VPN - To enable openconnect in Network Settings

  • Objective: Wants to connect to VPN in settings, but openconnect does not shows it there.

  • To enable openconnect in Linux Network settings.

    sudo apt install openconnect
    sudo apt install network-manager-openconnect network-manager-openconnect-gnome
    sudo systemctl restart NetworkManager