Ubuntu – Make multiple files hidden

command linehidden-files

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?


Best Answer

  • 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