Learn how to combine the ls command with head to show us the five last modified files in a directory.
Also find me here:
Baeldung Author
Rens Verhage
Java Software Developer and DevOps engineer from The Neterlands with 15+ years experience in developing enterprise web applications. Cloud enthousiast. World traveler and scuba diver.
Here's what I've written (so far):
Baeldung on Linux
- All
- Scripting (5)
- Administration (5)
- Processes (4)
- Files (3)
- Security (2)
- Filesystems (2)
- File Viewing (2)
- Web (1)
- Networking (1)
- Installation (1)
- File Searching (1)
- File Compression (1)
Looping Through the Content of a File in Bash
In this tutorial, we’ll see how to loop through the contents of a file, line by line. This might sound like a trivial task, but there are some caveats that we need to be aware of.
Meaning of Tilde in Linux Bash
Filed under Filesystems
Explore the Bash feature called tilde expansion.
Copying SSH Keys To Another Machine
Filed under Administration, Security
Learn how to copy our SSH keys to other machines
Standard Exit Status Codes in Linux
Filed under Scripting
A quick and practical guide to Linux exit codes.
Aborting a Shell Script if Any Command Fails
Learn how to use set -e to make bash scripts terminate immediately when some error occurs.
Set Up cURL to Permanently Use a Proxy
Filed under Web
Learn how to make curl permanently send all requests through a proxy server.
Introduction to Bash Globbing
Filed under File Searching, File Viewing
Learn about the process of filename expansion, also known as globbing.
Specify an Editor for Crontab
Filed under Administration
Learn how to make crontab -e use our favorite editor.
Mapping Hostnames with Ports in /etc/hosts
Filed under Administration, Networking
Learn how to map hostnames to specific ports.
Why Should We Disable Root-Login Over SSH?
Filed under Administration, Security
Learn why it’s not a good idea to enable root logins over SSH.
How To Script “Yes” When Installing Programs
Filed under Scripting
Let’s see how we can automatically answer yes in our scripts.
Managing Environment Variables in Linux
Filed under Administration, Processes
Learn how we can manage environment variables.
Understanding the time Command
Filed under Processes
Learn how to interpret the output of the time command.
Decompressing Files in Linux with Gunzip
Filed under File Compression, Files
Learn how to use gunzip to decompress gzip-compressed archives.
Linking to Files in Linux
Filed under Files
Learn four forms of ln command to create symbolic links.
Kill Commands in Linux
Filed under Processes
Learn how to use the kill command to terminate processes.
Cron Job Testing and Debugging in Linux
Filed under Scripting
Learn how to test Linux cron jobs.
Execute Programs From Anywhere in Linux
Filed under Installation
Explore ways in which we can make a program executable from anywhere in our system