Hidden File in Linux
Hidden file is like a regular file with a dot "." prefixed.
Syntax:-
$touch .[file name]
$vi/vim .[file name]
Example:-
suppose you want to create a file name 'tom' then the command will be given below:-
$touch .tom
$vi/vim .tom
now you want see the name of the hidden file in a current directory, then command will be given below:-
$ls -a
a-all files and directories
the list will contain both hidden file and regular file.
But user want to display only hidden file name in a current directory,then command will be given below:-
$ls -a | grep -e "^\." [grep command is used to find regular expression from a file]
or
$ls -a .*
Syntax:-
$touch .[file name]
$vi/vim .[file name]
Example:-
suppose you want to create a file name 'tom' then the command will be given below:-
$touch .tom
$vi/vim .tom
now you want see the name of the hidden file in a current directory, then command will be given below:-
$ls -a
a-all files and directories
the list will contain both hidden file and regular file.
But user want to display only hidden file name in a current directory,then command will be given below:-
$ls -a | grep -e "^\." [grep command is used to find regular expression from a file]
or
$ls -a .*
Comments
Post a Comment