Command Line

While working on the command line, I hate opening up files in editors just to create files that would contain measly content like, .rvmrc, phpinfo files and README files.

Fortunately, in Linux and Unix systems, you can easily create and modify files with just the command line. This guide will teach how to create and modify any text files without the use of a text editor on the Command line.

Create a file

This command simply lets you create files:

touch phpinfo.php

This command simply lets you create the files and start adding content. Press Ctrl+D to stop.

cat > phpinfo.php

Append content

This simply lets you append some text. In this case, <?php phpinfo();.

echo "<?php phpinfo();" > phpinfo.php

This command simply lets you append to the file specified. Press Ctrl+D to stop.

echo "<?php phpinfo();" > phpinfo.php

View a file’s content

cat phpinfo.php
<?php phpinfo();

‘Nuff said!