LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 08-06-2007, 07:38 AM   #1
anhtt
LQ Newbie
 
Registered: Jul 2007
Posts: 27

Rep: Reputation: 15
Hide directories on Unix


How to hide or unhide a directory or file on Unix.
 
Old 08-06-2007, 07:47 AM   #2
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,498

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
It depends on what do you mean for hide/unhide. The most simple answer to your question is: all files/directories whose name begins with a dot "." are not visible by the command ls or from a window, unless you tell explicitly to show them. BTW, I don't believe this is what you're looking for, since this is the default behaviour on most systems, aren't you?

Last edited by colucix; 08-06-2007 at 07:48 AM.
 
Old 08-06-2007, 12:03 PM   #3
anhtt
LQ Newbie
 
Registered: Jul 2007
Posts: 27

Original Poster
Rep: Reputation: 15
If we can't display all files/directories whose name begins with a dot "." by command "ls". And how can you know the existing of these files/directories if "ls" can't use?
If you want to set a file/diretory with "." as you told, which command you have to do ?
 
Old 08-06-2007, 12:19 PM   #4
jeenam
Member
 
Registered: Dec 2006
Distribution: Slackware 11
Posts: 144

Rep: Reputation: 15
ls -a

^^ Displays files/directories that begin with a dot. man ls.
 
Old 08-06-2007, 01:14 PM   #5
colucix
Moderator
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,498

Rep: Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956Reputation: 1956
Quote:
Originally Posted by anhtt
If you want to set a file/diretory with "." as you told, which command you have to do ?
Simply rename a file/directory with a leading dot:
Code:
mv pippo .pippo
makes the file or directory pippo to be "hidden". Beware of overwriting existing hidden files in your home directory, since the most of them are user's configuration files!

Last edited by colucix; 08-06-2007 at 01:17 PM.
 
Old 08-06-2007, 02:41 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,260
Blog Entries: 54

Rep: Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841Reputation: 2841
Quote:
Originally Posted by anhtt
How to hide or unhide a directory or file on Unix.
Use a rootkit?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Speaking UNIX, Part 4: Setting and managing permissions on UNIX LXer Syndicated Linux News 0 10-21-2006 01:54 AM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 12:23 PM
Hide directories using httpd.conf mell Linux - Networking 2 05-10-2004 02:53 PM
Why did you experienced users of Unix change to unix over Windows? Laptop2250 Linux - General 11 10-28-2003 11:51 AM
How to schedule unix script periodically from unix os level??? gopi_20us Programming 2 03-11-2002 06:45 AM


All times are GMT -5. The time now is 09:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration