How to manipulate files by command prompt ?
https://www.zyxware.com/sites/default/files/styles/user_image/public/default_images/index.png?itok=2YmREnrP
BY fazeela.ma
3 years ago
Linux-Terminal
0
comments comment

We are no strangers to commands in bash. Bash provides an ample amout of commands to manipulate on files. The main commands that are commonly used are,

  • cp - copy files and directories
  • mv - move or rename files and directories
  • rm - remove files and directories
  • mkdir - create directories

cp is a command used to copy the file in a particular destination to another. Eg.,

cp README.txt /home/zyx/Projects/zyx 

Here, we are trying to copy the file README.txt in the current directory to the folder zyx in the path /home/zyx/Projects/.

mv is a command used to move the file in a particular destination to another. Eg.,

mv README.txt /home/zyx/Projects/zyx 

Here, we are trying to move the file README.txt in the current directory to the folder zyx in the path /home/zyx/Projects/.

rm is a command used to remove the file in a particular destination. Eg.,

rm README.txt 

Here, we are trying to remove the file README.txt in the current directory.

The command mkdir is used to create a folder. Eg.,

mkdir new 

Here we trying to create a new folder in the current directory.

There is so many extensions are used along with these commands, which let us use it in interrative and in a recursive manner.


RELATED ARTICLE

close

on 12th October 2012 / by sandeep.sasikumar
The command "setfacl" refers to Set File Access Control Lists and "getfacl" refers to Get File Access Control List. Each file and directory in a Linux filesystem is created with a specific set of file permissions for its access. Each user can have different set of file access permissions. The permissions can be set using the setfacl utility. In order to know the access permissions of a file or directory we use getfacl. The getfacl command displays the access permissions of files and directories with file name, owner, group and the ACL's(Access Control List). When we create a directory it is created with a default set of access permissions and by using getfacl we will be able to see the access rights. Linux System Administration Linux Shell Linux Terminal Security Leave a reply Your email address will not be published. Required fields are marker * ts (not verified) access_time 19 Jul 2019 - 10:20 The above command: getfacl x | setfacl -R –setfile = -y must reaad like this to work: getfacl x | setfacl -R –setfile=- y TS (not verified) access_time 19 Jul 2019 - 10:20 Forget about my previous post. This is the correct syntax now getfacl x | setfacl -R –set-file=- y anju rohilla (not verified) access_time 19 Jul 2019 - 10:20 when we run the command like this # setfacl -m u:anju:rw- /html where anju is a user and html is a file in /. then it changes the acess of the for group not for the user,why? Add new comment
more_horiz
close

on 01st June 2013 / by deepa.n
Backup! Backup! Backup! Always back up your Drupal site's code and database before you actually start making any changes to your site. Do you have access to the control panel? Cool! Go ahead and create a zip file of your entire site, export your db, download it to your local machine and you are done. Read on to know how to backup your Drupal site. Ubuntu Drupal Linux Tips Linux Terminal Leave a reply Your email address will not be published. Required fields are marker *
Leave a reply
Your email address will not be published. Required fields are marker *

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type='1 A I'> <li> <dl> <dt> <dd> <h2 id='jump-*'> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
The content of this field is kept private and will not be shown publicly.
CAPTCHA This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.