Home » Linux » Tips

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 » Tips

How to Get CPU Information on Linux, With Examples

Get CPU Info in Linux

Here’s how to display the CPU info for your computer on Linux from the Linux command line. The CPU (Central Processing Unit) in your computer does all of the number crunching and processing and logic that your computer needs to do to, well, compute. It’s the brains of the whole operation. The type of CPU, how old it is, and how fast it is determines how responsive your computer is and how quickly it can do things. CPU Info From /proc/cpuinfo One of the core … Read more

Home » Linux » Tips

List Running Processes in Linux with ps, top, or htop

Linux List Processes

This article will show you how to list running processes in Linux using several tools. This will allow you to see what is running and how your system resources are being consumed. It’s helpful to see what resources are in use by what process to diagnose slow systems. This information can be used to determine whether you need to purchase more memory (RAM), a faster processor, or whether an application or service on your computer is misconfigured and using more resources than it should. What … Read more

Home » Linux » Tips

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

Home » Linux » Tips

Find Large Files in Ubuntu/Linux (du/ncdu), With Examples

Ubuntu Linux Find Large Files

Running out of disk space? Here’s how to find large files in Ubuntu (and other Linux distributions) without any fuss using the du and ncdu commands. The du Command The du (Disk Usage) command does what it says it does – tells you about the disk usage of files in a given directory. du Command Syntax du OPTIONS PATH Note that: – OPTIONS is an optional space-separated list of options from the du command manual – OPTIONS will allow you to specify things like maximum and minimum file sizes to include, what unit to measure file sizes … Read more

Home » Linux » Tips

Restarting the Network in Ubuntu [Instructions/Example]

Restart Network Ubuntu

If you’ve recently updated your network configuration or just can’t get things to connect, you may need to restart the networking services on your Ubuntu System to get things back up and running. Restarting the network is particularly useful if you’re recently updated your WiFi network details or changed your IP address or hostname. These examples will work for Ubuntu and should work for Ubuntu-based distributions like Pop!_OS and Linux Mint. Restarting the Network Service from the Linux Terminal/Command Line This is probably the solution you’re looking for … Read more

Home » Linux » Tips

Recover Deleted Files in Ubuntu/Linux, With Examples

Ubuntu Recover Deleted Files

We’ve all been there (I’ve been there) – a file was deleted that shouldn’t have been. Here is how to attempt recovery on Ubuntu/Linux. with examples. Backup Your Files First up, keep backups of your files, and keep your backups up to date. The easiest way to recover a file is not to have to try to recover it at all – you can just go and retrieve it from your backup. No fuss. No stress. No praying. How Deleted Files are Recovered When a file … Read more

Home » Linux » Tips

Getting the Absolute (Full) and Relative Path In Linux

Absolute Paths in Linux

This article explains absolute paths and how they differ from relative paths, getting them, and how symbolic links are handled. FileSystem Paths A path is the location of a file in a file system. It’s the directions to the file in the folder it is located. A path consists of a string of characters. Some represent directory names, and a separator character separates the directory names from the file name and extension. Consider the below path: /path/to/my/file.txt It consists of: Forward slashes (/) to separate directories from their subdirectories … Read more

Home » Linux » Tips

Remove a User From the Linux Command Line/Shell – How to Do It

Linux Remove User

Here’s a short and sharp article on how to remove a user from a Linux system. These examples will work on the majority of Linux distributions. The userdel Command The userdel command can be run from the Linux shell to remove a user. Here’s the syntax: userdel OPTIONS USERNAME Note that: OPTIONS should be from the below table USERNAME should be the login username of the user to be deleted userdel requires administrative rights and will need to be run as root or using the sudo command BE AWARE – RUNNING ANY userdel … Read more

Home » Linux » Tips

How to List Users and Groups in Linux, With Examples

Linux List Users Groups

Linux supports multiple users and groups, allowing access to be granted to only the resources required.  Here’s how to list users, groups, and group membership. Separating users and groups ensures that different people can’t accidentally interfere with each other’s files and ensures system security by denying access to vital system files. This article details the various ways to query the users and groups on a computer running a Linux Operating System. Listing All Users The /etc/passwd file is a text-file database containing information on all of the users … Read more