Thursday, May 2, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 2926  / 3 Years ago, sat, may 1, 2021, 6:14:10

I have a group of files I want hidden to avoid clutter. Is there a command that can simply make multiple files hidden? Is there an application? Is there a single command that will make the files I've listed hidden?



Thanks.


More From » command-line

 Answers
1

The Linux convention is to rename them to start with a .. Most programs, including Nautilus (the GNOME file browser), Dolphin (KDE), and command-line programs like ls and Bash's shell globbing, will then hide them (by default).



To rename multiple files simultaneously, you could use any of several graphical tools:





In PyRenamer, select your files, activate the "Insert / Delete" tab, and tell it to insert a . at position 1:



Sample pyrenamer



From the command-line, the conventional way is to use mv and find (if needed). If you have only a few specific files you want to hide, run:



for f in file0 file1 file2 file3; do mv "$f" ".$f"; done


to append a . to each file's names.



If you have several similarly-named files you want to hide (e.g. any file starting with hideme), use shell globbing:



for f in hideme*; do mv "$f" ".$f"; done

[#33417] Monday, May 3, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ettorina

Total Points: 439
Total Questions: 99
Total Answers: 131

Location: Vanuatu
Member since Wed, Oct 14, 2020
4 Years ago
ettorina questions
Thu, Sep 1, 22, 15:28, 2 Years ago
Mon, Mar 14, 22, 06:04, 2 Years ago
Sun, Jul 24, 22, 13:31, 2 Years ago
;