From cae0769e3c668a71ab98741bb4aa3fb87ff97ad7 Mon Sep 17 00:00:00 2001 From: arterhacker Date: Mon, 24 Apr 2017 22:25:03 +0300 Subject: [PATCH] chown added (#34) * chown added * add chown command * add chown command --- README.md | 77 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 005c28d..81cea7b 100644 --- a/README.md +++ b/README.md @@ -80,25 +80,26 @@ Clears content on window. cat chmod - cp - diff - file - find - gunzip - gzcat - gzip - head + chown + cp + diff + file + find + gunzip + gzcat + gzip + head - lpq - lpr - lprm - ls - more - mv - rm - tail - touch + lpq + lpr + lprm + ls + more + mv + rm + tail + touch @@ -116,25 +117,31 @@ cat < file1 > file2 #copy file1 to file2 ``` ### b. `chmod` -Lets you change the read, write, and execute permissions on your files. For more information on this command check this [link](https://ss64.com/bash/chmod.html). +The chmod command stands for "change mode" and allows you to change the read, write, and execute permissions on your files and folders. For more information on this command check this [link](https://ss64.com/bash/chmod.html). ```bash chmod -options filename ``` -### c. `cp` +### c. `chown` +The chown command stands for "change owner", and allows you to change the owner of a given file or folder, which can be a user and a group. Basic usage is simple forward first comes the user (owner), and then the group, delimited by a colon. +```bash +chown -options user:group filename +``` + +### d. `cp` Copies a file from one location to other. ```bash cp filename1 filename2 ``` Where `filename1` is the source path to the file and `filename2` is the destination path to the file. -### d. `diff` +### e. `diff` Compares files, and lists their differences. ```bash diff filename1 filename2 ``` -### e. `file` +### f. `file` Determine file type. ```bash file filename @@ -144,7 +151,7 @@ Example: $ file index.html index.html: HTML document, ASCII text ``` -### f. `find` +### g. `find` Find files in directory ```bash find directory options pattern @@ -155,31 +162,31 @@ $ find . -name README.md $ find /home/user1 -name '*.png' ``` -### g. `gunzip` +### h. `gunzip` Un-compresses files compressed by gzip. ```bash gunzip filename ``` -### h. `gzcat` +### i. `gzcat` Lets you look at gzipped file without actually having to gunzip it. ```bash gzcat filename ``` -### i. `gzip` +### j. `gzip` Compresses files. ```bash gzip filename ``` -### j. `head` +### k. `head` Outputs the first 10 lines of file ```bash head filename ``` -### k. `lpq` +### l. `lpq` Check out the printer queue. ```bash lpq @@ -192,19 +199,19 @@ active adnanad 59 demo 399360 bytes 1st adnanad 60 (stdin) 0 bytes ``` -### l. `lpr` +### m. `lpr` Print the file. ```bash lpr filename ``` -### m. `lprm` +### n. `lprm` Remove something from the printer queue. ```bash lprm jobnumber ``` -### n. `ls` +### o. `ls` Lists your files. `ls` has many options: `-l` lists files in 'long format', which contains the exact size of the file, who owns the file, who has the right to look at it, and when it was last modified. `-a` lists all files, including hidden files. For more information on this command check this [link](https://ss64.com/bash/ls.html). ```bash ls option @@ -222,13 +229,13 @@ drwxr-xr-x 17 adnan staff 578 Mar 27 23:36 .git -rwxr-xr-x 1 adnan staff 2702 Mar 25 18:08 .gitignore -### o. `more` +### p. `more` Shows the first part of a file (move with space and type q to quit). ```bash more filename ``` -### p. `mv` +### q. `mv` Moves a file from one location to other. ```bash mv filename1 filename2 @@ -240,7 +247,7 @@ Also it can be used for rename a file. mv old_name new_name ``` -### q. `rm` +### r. `rm` Removes a file. Using this command on a directory gives you an error. `rm: directory: is a directory` To remove a directory you have to pass `-r` which will remove the content of the directory recursively. Optionally you can use `-f` flag to force the deletion i.e. without any confirmations etc. @@ -248,13 +255,13 @@ To remove a directory you have to pass `-r` which will remove the content of the rm filename ``` -### r. `tail` +### s. `tail` Outputs the last 10 lines of file. Use `-f` to output appended data as the file grows. ```bash tail filename ``` -### s. `touch` +### t. `touch` Updates access and modification time stamps of your file. If it doesn't exists, it'll be created. ```bash touch filename