May 17, 2021

Basic linux file commands

1) Creating an empty file. We can use touch command for make a new file in Linux. Syntax is following.
touch [new file name]
2) Deleting a file When deleting a file we use the command rm.
rm [file name]
  3) Copy or move a file. For copy a file to a different location we use cp command.
cp /var/www/html/new.php /temp
To move a file we use same syntax with the command mv.
mv /var/www/html/new.php /temp
4) Renaming a file. The command we use to rename a file is same as moving file.we can do it like this.
mv /var/www/html/new.php /var/www/html/new2.php
linux-mv-rename 5) Know what in a file when we need to quickly check what inside a file we use cat command.
Cat [file name]
linux-cat-and-echo There are another two commands like cat. Head command can be used to see what inside the head section of a file and tail is used to see last section of a file head [file name] tail [file name] 6) Edit a file nano [file name] for editing text file and any other files we can use a simple CLI editor called nano. 7) Giving permissions to a file.
chmod -R 777 [file name]
The chmod command is used to give or edit permissions to a folder or a file.
Jun 20
SEO friendly url with PHP

When it comes to search engine optimization, URL structure plays an important role. If the URL....

Jun 09
Python Inputs and Outputs

Getting user inputs is an essential part of a program. In python we have several ways to get inputs....

Sep 23
PUSH and POP with stack

This is the second tutorial of our stack tutorial set. Hear we are going to talk about some two....

Replying to 's comment Cancel reply
CATEGORIES
ABOUT AUTHER
Thilan Danushka Dissanayaka

Thilan Dissanayaka

Hi, I'm Thilan from Srilanka. An undergraduate Engineering student of University of Ruhuna. I love to explorer things about CS, Hacking, Reverse engineering etc.

SOCIAL
RANDOM ARTICLES