10 Quick Linux Tips and Tricks for DevOps💡: How to Make the Search Insensitive and Others.

Andrey Byhalenko
DevOps Manuals and Technical Notes
3 min readMar 2, 2024

Here are some quick tips for better work with Linux, used in my DevOps practice.

As you know, Linux and the UNIX system are case-sensitive.
What if you need to find any specific text but are not sure if it’s lowercase or uppercase?

Simply use the grep -i command; it makes the search insensitive to case.

Instead of doing this:

mkdir mydir
cd mydir

Add this function to the ~/.bashrc and call it next time:

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

Find all files that were edited in the last 10 minutes:

find . -type f -mmin -10

Check the disk usage to find out which files are taking the most disk space:

sudo du -hsx /* | sort -rh | head -n 5

Run multiple commands with one command:

command1 ; command2 ; command3 ; command4

Run the following command only if the previous one runs successfully:

command1 && command2 && command3 && command4

List files sorted by size:

ls -laSh

Get the virtual memory statistics report:

vmstat 1 5
# 1 = the values will be re-measured and reported every second.
# 5 = the values will be reported five times, and then the program will stop.

Display file permissions in a user-friendly format.

getfacl

Add a timestamp to your bash history, execute:

export HISTTIMEFORMAT="%d/%m/%y %T "

Add this line to the .bashrc if you want to make it permanent.

If you liked my articles, you can join my newsletter, and you will receive weekly DevOps tutorials, articles, and tips every Saturday.

As a bonus, you will receive a free step-by-step DevOps CI/CD project, which you can use in your portfolio.

Subscribe here: https://junior-devops-hub.ck.page

--

--

Andrey Byhalenko
DevOps Manuals and Technical Notes

I'm a DevOps Engineer, Photography Enthusiast, and Traveler. I write articles aimed at junior DevOps engineers and those aspiring to become DevOps engineers.