Coderwall

Topics by Tech

Ruby Python JavaScript Web Tools iOS PHP Android .NET Java

Software Categories

API gateway APM product comparisons Application security Certification platform Data integration Email gateway Subscription analytics

Quick Links

Recent Trending Popular Discover Topics Topic Categories Discover Software Categories
Jobs
Discover Topics Browse every programming topic Topic Categories Programming languages, frameworks and tools, grouped by categories
Recent Trending Popular

Topics by Tech

Ruby Python JavaScript Web Tools iOS PHP Android .NET Java
Discover Software Categories Browse every software category
API gateway APM product comparisons Application security Certification platform Data integration Email gateway Subscription analytics
Jobs
Sign In or Up
Last Updated: February 25, 2016
·
643
· juandiego

Remove 5 last modified files on bash

#shell
#bash
#command line
#linux
#automation
#shell script

Once in the directory containing the files:

ls -t | tail -n -5 | xargs -d '\n' rm -rf
#shell
#bash
#command line
#linux
#automation
#shell script

Written by Juan Diego Gonzales

Say Thanks
Respond

Related protips

Add git branch name to bash prompt

440.1K
4

Copy files to clipboard using command line on OSX

308.4K
4

The single most useful thing in bash

228.5K
64

Have a fresh tip? Share with Coderwall community!

Post
Post a tip
Best #Shell Authors
itseranga
623.1K
#shell
#cryptography
#docker
jmarizgit
339.3K
#shell
#Javascript
#PHP
dotcode
234.3K
#shell
#Web Performance
#Python
mehikmat
207.4K
#shell
#java
#Python
sheerun
199.6K
#shell
#ruby
#coffeescript
Related Tags
#shell
#bash
#command line
#linux
#automation
#shell script
Sponsored by
#native_company#
#native_desc#
#native_cta#
Filed Under

Everyday tools of the trade
Bash tips you will reuse
Linux tips from the metal up
Awesome Job
See All Jobs

Post a job for only $299
Thanks to our sponsor
Sponsored by #native_company# — Learn More
#native_title# #native_desc#
#native_cta#
@coderwall
APM product comparisons Application security Contact Privacy Terms

Copyright 2026

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.