You are on page 1of 1

Creation of Files cat command

By using three methods we can create files To


Tocreate
createaafile
file
[root@comp1 ~]# cat > <filename>
[root@comp1 ~]# cat > <filename>
• cat command

• touch command To
Toview
viewthe
thecontent
contentof
ofaafile
file
[root@comp1
[root@comp1~]#
~]#cat
cat <filename>
<filename>
• vi editor

Displaying To
Toappend
appendaafile
file
Displaying&&Creating
CreatingText
TextFiles
Files
[root@comp1 [root@comp1
[root@comp1~]#
~]#cat
cat >>
>><filename>
<filename>
[root@comp1~]#
~]#cat
cat <options>
<options><arguments>
<arguments>

To
Totransfer
transferthe
thecontents
contentsof
offile1
file1&
&file2
file2to
tofile3
file3
[root@comp1 ~]# cat <file1> <file2> >> <file3>
[root@comp1 ~]# cat <file1> <file2> >> <file3>

touch command Creating Directories

To
Tocreate
createaadirectory
directory
[root@comp1
[root@comp1 ~]# mkdir <directoryname>
~]# mkdir <directory name>
To
Tocreate
createaafile
filewith
withzero
zerobytes
bytesasaswell
wellas
asto
tochange
changethe
thetime
time
stamp
stampofoffile
fileor
ordirectory.
directory.
[root@comp1
[root@comp1~]#~]#touch
touch <filename>
<filename>

To
Tocreate
createmultiple
multipledirectories
directories
[root@comp1
[root@comp1 ~]# mkdir <dir1> <dir2>
~]# mkdir <dir1> <dir2> <dir3>
<dir3>

To
Tocreate
createmultiple
multiplefiles
files
[root@comp1
[root@comp1~]#
~]#touch
touch <file1>
<file1> <file2>
<file2> <file3>
<file3>

To
Tocreate
createnested
nesteddirectories
directories
[root@comp1
[root@comp1~]#
~]#mkdir
mkdir -p
-p <dir1>/<dir2>/<dir3>
<dir1>/<dir2>/<dir3>

You might also like