Creating and adding to Linux file manager a right-click action using nemo_action

When using the file manager I like files to be sorted by date descending. Hence seeing the newest files and directories first on top and the ones I recently updated.

The problem is when you have nested directories and you update a file in a sub directory.

For example, consider this directory structure:

- flights
   +- Athens 2026-01 
        +- Hotels

If I add or update something in the "Hotels" directory, the "Athens 2026-01" directory does not pop up because I updated a sub-dir.

For this, I like the command "touch" in Linux. Touch allows me to change the timestamp of a file or a directory (and also creates new files and more).

I wanted to add the option inside the GUI of Linux file manager to right-click and "touch" a directory or a file.

I used nemo_actions (nemo actions) option to do so.

Step 1: Open the Actions Directory
Nemo looks for custom actions in a specific hidden folder. 

Open your file manager (Nemo).

Press Ctrl + H to show hidden files.

Navigate to: .local -> share -> nemo -> actions (Full path: /home/YOUR_USERNAME/.local/share/nemo/actions)

Step 2: Create the Action File
Right-click in the empty space of this folder and choose Create New Document -> Empty Document.

Name the file: touch.nemo_action (The name doesn't strictly matter, but the .nemo_action extension is mandatory).

Open this new file with a text editor and paste the following code:

[Nemo Action]
Name=Touch (Update Timestamp)
Comment=Update the timestamp of selected files/folders to now
Exec=touch %F
Icon-Name=preferences-system-time
Selection=notnone
Extensions=any;
Quote=double

 

Step 3: Test It
You usually do not need to restart Nemo.

Go to any other folder (e.g., Downloads).

Select a file or directory.

Right-click it.

You should now see "Touch (Update Timestamp)" in the menu. Clicking it will update the "Modified" date to right now. 

Comments

Popular posts from this blog

Accessing Windows Share (Samba) From Linux (XFCE) using Thunar

Bypassing the error by "go get" "tls: failed to verify certificate: x509: certificate signed by unknown authority"

Using phpword to merge two Mircrosoft Office Word .docx documents