Tag Archives: Bash

How to check packages support status for Ubuntu 18.04

To know which packages are supported and which are not, for how long and whether the community or canonical are the ones who support it, just run: ubuntu-support-status It will give you this sample output: Support status summary of ‘$HOSTNAME’: … Continue reading

Posted in Linux | Tagged , , , , | Leave a comment

A tiny script to replace all occurrences of a string in a file with another string

sed -i ‘s/original/new/g’ filename.txt This basically replaces every occurrence of the “original” string with the “new” string in the file named “filename.txt” e.g. sed -i ‘s/192.168.0.1/192.168.1.1/g’ /etc/fstab Will replace all occurrences of the IP “192.168.0.1” with the IP “192.168.1.1” in … Continue reading

Posted in Linux | Tagged , , , | 1 Comment

How to use the ip command to bring up/down the network interface on Linux

The ip command is replacing ifconfig, which is getting deprecated and some distros have already removed it. To bring a network interface down, simply run the following: sudo ip link set enp0s25 down To bring it back up: sudo ip … Continue reading

Posted in Linux | Tagged , , , , | Leave a comment

Integrating SSH PKI with Active Directory using PBIS-Open on Ubuntu 16.04

Long Article Warning! You can skip all this and go directly to the script at the end. This resolves the dilemma of managing SSH public keys on servers that are integrated with Active Directory using PBIS-Open, it allows you to … Continue reading

Posted in Linux | Tagged , , , , , , , , | 2 Comments

How to clear your bash history

For old commands, just edit .bash_history and delete whatever you want from inside. For commands in the current session, just run this command before you exit: unset HISTFILE The $HISTFILE environment variable is the one which holds your commands and … Continue reading

Posted in Linux, Uncategorized | Tagged , , , | Leave a comment

How to delete all files in a folder EXCEPT certain ones in BASH

Imagine you have a folder that has about 20 files that you need and like 100 files that you don’t. In this case, there is a very simple bash script that allows you to do that in a jiffy! Here … Continue reading

Posted in Linux, Uncategorized | Tagged , , , | Leave a comment

How to change the Linux prompt

Sometimes the Linux prompt doesn’t look really attractive and/or practical, like for example bash:/ or sh:/ which is really annoying. To solve this, you need to use the PS1 environment variable and append to it what you need: Go to … Continue reading

Posted in Linux | Tagged , , | Leave a comment