Home » Linux » Shell

Linux man Command and Man Pages [Explanation/Examples]

Linux man Command

This article describes the purpose and usage of the man command in Linux and other Unix-like operating systems. Linux is a highly modular operating system, consisting of the core operating system (the Linux Kernel) and a collection of software packages that add functionality to it. These packages are generally individually maintained. Thus, each computer system will have different packages depending on what the user requires their system to do (for example, a graphic designer will have some drawing tools installed, whereas someone writing a novel may instead … Read more

Home » Linux » Shell

Linux clear Command and Clearing Shell/Terminal Screen

Linux clear Command

This article will show you how to use the Linux clear command to clear the terminal screen. Quick and easy! Clearing the Terminal/Shell Screen If you’ve been executing a bunch of commands from your Linux terminal, things can start to look a bit cluttered. It would help if you could clear the screen of previous output and commands and have a fresh start. That’s what the clear command is for. clear Command Syntax Here’s the syntax for the clear command: clear Pretty simple. There are a couple of options to change … Read more

Home » Linux » Shell

How to use the Linux locate Command, With Examples

Linux locate Command

Here’s another tool for your Linux file searching toolbox – the locate command. This explains how to use it. The locate command is specifically made for finding files and folders by their name. It’s easy to use and can search for files using patterns. This is helpful if you are looking for files with a specific type/file extension. Installing locate locate may not be installed by default on your system. To install on Debian/Ubuntu-based distributions, run: sudo apt install mlocate Or on Redhat/CentOS/Fedora: sudo yum install mlocate Linux locate Command Syntax The locate … Read more

Home » Linux » Shell

How to Use the watch Command in Linux, With Examples

Linux watch command

The watch command in Linux does one thing – repeats a command and outputs the result repeatedly, letting you watch for changes. Here’s how to use it. watch Command Syntax The syntax for the watch command is as follows: watch OPTIONS COMMAND Note that: OPTIONS should be a list of options from the below table, which will alter the default behavior of the watch command COMMAND is the command that watch should repeatedly execute, which you will monitor the output of watch will run until interrupted (So press CTRL+C to exit … Read more

Home » Linux » Shell

Bash/Shell Script to Send Email In Linux – Howto, Example

Sending Emails from Bash/Command Line

This article will show you several ways to send an email from the Linux command line/shell – as well as from Bash/Shell scripts. Why would you want to send an email from the command line? Probably not to communicate – most people use an email client with a nice user interface to send messages to each other day to day – but you may want to have your computer send an email notification when a task completes or when an event occurs. Such email alerts … Read more

Home » Linux » Shell

How to Format a USB Drive From the Linux Shell

Format USB Drive in Linux

This article will show you how to format a USB stick or external USB hard drive from the Linux command line/shell for FAT, NTFS, and EXT file systems. Plug In the Drive The first step – plug in your USB stick or external hard drive and give it a few moments to be detected. Find the Drive Next, find the drive you just plugged in using the fdisk command to list (-l) the attached storage devices: sudo fdisk -l We’ll be using the sudo command frequently – many of … Read more

Home » Linux » Shell

Mount a USB Stick/Drive in Linux [HowTo, Tutorial]

Mount a USB Drive in Linux

This tutorial will show you how to mount and access a USB stick or external USB hard drive on Linux. Most desktop Linux distributions will automatically mount USB drives show them in their file explorer, but lightweight and server distributions may not include this functionality – either because it’s considered unnecessary or because the typical user of said distribution wants to be able to do manage those tasks themselves. Modern Linux distributions should all include drivers for USB sticks and external drives, so it’s just … Read more

Home » Linux » Shell

tee Command in Linux – Split Shell Output [Examples]

Linux tee Command

The tee command in the Linux Shell/command line splits the output of an application – sending output to both a file and STDOUT (the console or another application). Here’s how to use it. The tee command is named for a T-splitter used in plumbing – a pipe that redirects water from a single source in two directions. tee Command Syntax tee is a command with a simple purpose and simple syntax: tee OPTIONS FILE Note that: OPTIONS is a list of options from the below table FILE is the path to … Read more

Home » Linux » Shell

The uniq Command In Linux – Tutorial and Examples

Linux uniq Command

This article will explain how to use the uniq command in Linux to find or filter repeated lines in files and provide some usage examples. The uniq command is a simple command which either outputs or omits repeated lines in the supplied input or file. uniq Command Syntax The syntax for the uniq command is as follows: uniq OPTIONS INPUT OUTPUT Note that: OPTIONS is a list of options from the below table INPUT should be the path to the file to be read *Standard input *can also be used OUTPUT should be … Read more

Home » Linux » Shell

Delete Files Older Than X Days/Hours in Bash [Examples]

Bash Deleting Files Older Than X

This article will show you how to delete files older than a given number of days (or hours/minutes) manually or automatically via a Bash script. Examples included. Removing files older than a certain number of days (or minutes, or hours) makes use of two Linux commands – rm and find. Deleting Files with rm First up, the rm command. The rm command is used to remove files and directories in Linux. Here’s a whole article about how it’s used: rm Command in Linux [With Examples] Passing a Filtered List of Files to rm The next … Read more