LEARN HOW TO HIDE FILE AND FOLDER IN LINUX TO SECURE YOUR DATA

In this post i’m going to show you how to create hidden file in Linux . And also how to hide your important file in Linux

  • As you know to check all files in that directory you type  ls or ls -l command . But these command won’t show you files that are hidden in that directory .
[root@localhost ~]# ls -l
total 2938308
-rw------- 1 root root       1108 Jan 10 04:06 anaconda-ks.cfg
drwxr-xr-x 3 root root       4096 Jan 11 00:22 Desktop
-rw-r--r-- 1 root root      29623 Jan 10 04:06 install.log
-rw-r--r-- 1 root root       3661 Jan 10 04:06 install.log.syslog
-rw-r--r-- 1 root root 3005818880 Jan 10 23:40 rhel54iso.iso

 

HOW TO CREATE HIDDEN FILE IN LINUX

 

  • First create a file and don’t forget to put (.) point in front of that file .
[root@localhost ~]# vim .Deepit.txt
  • Now give the content to this file .Press I to go to insert mode and then type .
hii my name is Deepit
my site - deepitp5.wordpress.com
gemini - sagitarrius
KNOWS - CCNA , LINUX , WEB DESIGNING , WINDOWS , ETHICAL HACKING ,
ANDROID AND IOS , CLOUD COMPUTING
~
  • Press ESC and type :wq (to save and quit)
~
~
~
:wq
  • Done ! Now type ls -l command or ls command to check file and folder in that directory .
  • You created a file few seconds ago but it’s not showing anything in that directory because its hidden .
[root@localhost ~]# ls -l
total 2938308
-rw------- 1 root root       1108 Jan 10 04:06 anaconda-ks.cfg
drwxr-xr-x 3 root root       4096 Jan 11 00:22 Desktop
-rw-r--r-- 1 root root      29623 Jan 10 04:06 install.log
-rw-r--r-- 1 root root       3661 Jan 10 04:06 install.log.syslog
-rw-r--r-- 1 root root 3005818880 Jan 10 23:40 rhel54iso.iso
  • Don’t worry there’s one more command , and it’s for checking all hidden files in that directory . Type ls -la  .  As you can see my file .deepit.txt is now visible .  
[root@localhost ~]# ls -la
total 2938532
drwxr-x--- 16 root root       4096 Jan 11 22:57 .
drwxr-xr-x 24 root root       4096 Jan 11 22:45 ..
-rw-------  1 root root       1108 Jan 10 04:06 anaconda-ks.cfg
-rw-------  1 root root        401 Jan 11 01:49 .bash_history
-rw-r--r--  1 root root         24 Jul 12  2006 .bash_logout
-rw-r--r--  1 root root        191 Jul 12  2006 .bash_profile
-rw-r--r--  1 root root        176 Jul 12  2006 .bashrc
-rw-r--r--  1 root root        100 Jul 12  2006 .cshrc
-rw-r--r--  1 root root        180 Jan 11 22:57 .Deepit.txt
drwxr-xr-x  3 root root       4096 Jan 11 00:22 Desktop
-rw-------  1 root root         26 Jan 10 04:12 .dmrc
drwxr-x---  2 root root       4096 Jan 10 04:12 .eggcups
drwx------  2 root root       4096 Jan 10 23:41 .elinks
drwx------  4 root root       4096 Jan 11 01:16 .gconf
drwx------  2 root root       4096 Jan 11 01:45 .gconfd
drwxr-xr-x  3 root root       4096 Jan 10 04:12 .gnome
drwx------  6 root root       4096 Jan 10 04:12 .gnome2
drwx------  2 root root       4096 Jan 10 04:12 .gnome2_private
drwxr-xr-x  2 root root       4096 Jan 10 04:12 .gstreamer-0.10
-rw-r--r--  1 root root         81 Jan 10 04:12 .gtkrc-1.2-gnome2

That’s how  you can create hidden  file in linux .

You guys might be thinking does this point before file  apply on  folder .

Yeah ! it does .

 

Now how to hide a file in linux that is already been created

 

  • Create a folder . While creating don’t forget to put (.) point in front of folder too .
[root@localhost ~]# mkdir .Deepit
  • Now you can check your folder is also hidden .
[root@localhost ~]# ls
anaconda-ks.cfg  Desktop  install.log  install.log.syslog  rhel54iso.iso
  • Now i’m going to hide my file which is not hidden into that hidden folder .
  • About below command     mv  – move
  • next type filename or folder name
  • then  path where you want to move that file or folder .
[root@localhost ~]# mv Deepitp5.txt .Deepit
  • Now go to hidden file ,while going to that folder keep that point before giving folder name  .  Otherwise system won’t recognize the folder .
  • And type ls -la command to see files that we recently moved .
[root@localhost ~]# cd .Deepit
[root@localhost .Deepit]# ls -la
total 24
drwxr-xr-x  2 root root 4096 Jan 11 23:00 .
drwxr-x--- 17 root root 4096 Jan 11 23:00 ..
-rw-r--r--  1 root root  180 Jan 11 22:57 Deepit.txt

SO NOW YOU CAN HIDE IMPORTANT FILES AND FOLDER FROM MALICIOUS USERS .

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s