Skip to content

FAQforge

  • Site Notice
  • Privacy Policy
    • Cookie Declaration

bash

Get the name of the newest file in a directory on the linux shell

by Till Brehm

If you have a directory with many files (a few thousand in my case) and need to know which one is the newest, then the following command might be useful. It returns the name and details of the newest file in a directory where it is executed: ls -tl | sed -n 2p

Categories Basics, CentOS, Debian, Distributions, Linux & Unix, Ubuntu Tags bash, Shell, shellscript 5 Comments

How to clear Bash history on Linux

by Till Brehm
Clear Bash History

The bash history is a log file that contains all commands that the user executed on the Linux shell. When you use the "arrow up" key on our keyboard, then Bash will look up the previous command from that file and display it on the screen, ready to be executed again. Bash history file location The ... Read more

Categories Basics, CentOS, Debian, Distributions, Linux & Unix, Ubuntu Tags bash, Shell Leave a comment

Recent Posts

  • Yarn Installation on Debian Linux
  • Fetch Emails from Gmail via POP3 or IMAP on Ubuntu 22.04
  • How to relay email from Postfix mail server to Gmail on Ubuntu 22.04
  • How to Install Mono on Debian Linux
  • How to Install Gradle Build Tool on Rocky Linux

Categories

  • Android
  • Basics
  • CentOS
  • Controlpanels
  • Debian
  • Distributions
  • Email
  • FTP
  • iPad & iPhone
  • ISPConfig 2
  • ISPConfig 3
  • Linux & Unix
  • Mac OS X
  • Microsoft Exchange Server 2016
  • MySQL
  • O365
  • PostgreSQL
  • PowerShell
  • Programming
  • Server
  • Ubuntu
  • Uncategorized
  • Virtualisation
  • Vista
  • Webserver
  • Windows
  • Windows 10
  • Windows 7
  • Windows 8
  • Windows Server 2012 R2
  • Windows Server 2016
  • XP

Search

Categories

  • Android
  • Basics
  • CentOS
  • Controlpanels
  • Debian
  • Distributions
  • Email
  • FTP
  • iPad & iPhone
  • ISPConfig 2
  • ISPConfig 3
  • Linux & Unix
  • Mac OS X
  • Microsoft Exchange Server 2016
  • MySQL
  • O365
  • PostgreSQL
  • PowerShell
  • Programming
  • Server
  • Ubuntu
  • Uncategorized
  • Virtualisation
  • Vista
  • Webserver
  • Windows
  • Windows 10
  • Windows 7
  • Windows 8
  • Windows Server 2012 R2
  • Windows Server 2016
  • XP

Pages

  • Privacy Policy
  • Site Notice
© 2023 FAQforge • Built with GeneratePress