mirror of
https://github.com/Idnan/bash-guide.git
synced 2018-11-09 02:29:39 +01:00
minor update
This commit is contained in:
parent
b7a87a856a
commit
911be8949e
75
README.md
75
README.md
@ -72,22 +72,22 @@ Clears content on window.
|
|||||||
<td><a href="#c-cp">cp</a></td>
|
<td><a href="#c-cp">cp</a></td>
|
||||||
<td><a href="#d-diff">diff</a></td>
|
<td><a href="#d-diff">diff</a></td>
|
||||||
<td><a href="#e-file">file</a></td>
|
<td><a href="#e-file">file</a></td>
|
||||||
<td><a href="#f-gunzip">gunzip</a></td>
|
<td><a href="#f-find">find</a></td>
|
||||||
<td><a href="#g-gzcat">gzcat</a></td>
|
<td><a href="#g-gunzip">gunzip</a></td>
|
||||||
<td><a href="#h-gzip">gzip</a></td>
|
<td><a href="#h-gzcat">gzcat</a></td>
|
||||||
<td><a href="#i-head">head</a></td>
|
<td><a href="#i-gzip">gzip</a></td>
|
||||||
<td><a href="#j-lpq">lpq</a></td>
|
<td><a href="#j-head">head</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="#k-lpr">lpr</a></td>
|
<td><a href="#k-lpq">lpq</a></td>
|
||||||
<td><a href="#l-lprm">lprm</a></td>
|
<td><a href="#l-lpr">lpr</a></td>
|
||||||
<td><a href="#m-ls">ls</a></td>
|
<td><a href="#m-lprm">lprm</a></td>
|
||||||
<td><a href="#n-more">more</a></td>
|
<td><a href="#n-ls">ls</a></td>
|
||||||
<td><a href="#o-mv">mv</a></td>
|
<td><a href="#o-more">more</a></td>
|
||||||
<td><a href="#p-rm">rm</a></td>
|
<td><a href="#p-mv">mv</a></td>
|
||||||
<td><a href="#q-tail">tail</a></td>
|
<td><a href="#q-rm">rm</a></td>
|
||||||
<td><a href="#r-touch">touch</a></td>
|
<td><a href="#r-tail">tail</a></td>
|
||||||
<td><a href="#s-find">find</a></td>
|
<td><a href="#s-touch">touch</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -132,32 +132,42 @@ Example:
|
|||||||
$ file index.html
|
$ file index.html
|
||||||
index.html: HTML document, ASCII text
|
index.html: HTML document, ASCII text
|
||||||
```
|
```
|
||||||
|
### f. `find`
|
||||||
|
Find files in directory
|
||||||
|
```bash
|
||||||
|
find directory options pattern
|
||||||
|
```
|
||||||
|
Example:
|
||||||
|
```bash
|
||||||
|
$ find . -name README.md
|
||||||
|
$ find /home/user1 -name '*.png'
|
||||||
|
```
|
||||||
|
|
||||||
### f. `gunzip`
|
### g. `gunzip`
|
||||||
Un-compresses files compressed by gzip.
|
Un-compresses files compressed by gzip.
|
||||||
```bash
|
```bash
|
||||||
gunzip filename
|
gunzip filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### g. `gzcat`
|
### h. `gzcat`
|
||||||
Lets you look at gzipped file without actually having to gunzip it.
|
Lets you look at gzipped file without actually having to gunzip it.
|
||||||
```bash
|
```bash
|
||||||
gzcat filename
|
gzcat filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### h. `gzip`
|
### i. `gzip`
|
||||||
Compresses files.
|
Compresses files.
|
||||||
```bash
|
```bash
|
||||||
gzip filename
|
gzip filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### i. `head`
|
### j. `head`
|
||||||
Outputs the first 10 lines of file
|
Outputs the first 10 lines of file
|
||||||
```bash
|
```bash
|
||||||
head filename
|
head filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### j. `lpq`
|
### k. `lpq`
|
||||||
Check out the printer queue.
|
Check out the printer queue.
|
||||||
```bash
|
```bash
|
||||||
lpq
|
lpq
|
||||||
@ -170,19 +180,19 @@ active adnanad 59 demo 399360 bytes
|
|||||||
1st adnanad 60 (stdin) 0 bytes
|
1st adnanad 60 (stdin) 0 bytes
|
||||||
```
|
```
|
||||||
|
|
||||||
### k. `lpr`
|
### l. `lpr`
|
||||||
Print the file.
|
Print the file.
|
||||||
```bash
|
```bash
|
||||||
lpr filename
|
lpr filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### l. `lprm`
|
### m. `lprm`
|
||||||
Remove something from the printer queue.
|
Remove something from the printer queue.
|
||||||
```bash
|
```bash
|
||||||
lprm jobnumber
|
lprm jobnumber
|
||||||
```
|
```
|
||||||
|
|
||||||
### m. `ls`
|
### n. `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).
|
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
|
```bash
|
||||||
ls option
|
ls option
|
||||||
@ -200,20 +210,20 @@ drwxr-xr-x 17 adnan staff 578 Mar 27 23:36 .git
|
|||||||
-rwxr-xr-x 1 adnan staff 2702 Mar 25 18:08 .gitignore
|
-rwxr-xr-x 1 adnan staff 2702 Mar 25 18:08 .gitignore
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
### n. `more`
|
### o. `more`
|
||||||
Shows the first part of a file (move with space and type q to quit).
|
Shows the first part of a file (move with space and type q to quit).
|
||||||
```bash
|
```bash
|
||||||
more filename
|
more filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### o. `mv`
|
### p. `mv`
|
||||||
Moves a file from one location to other.
|
Moves a file from one location to other.
|
||||||
```bash
|
```bash
|
||||||
mv filename1 filename2
|
mv filename1 filename2
|
||||||
```
|
```
|
||||||
Where `filename1` is the source path to the file and `filename2` is the destination path to the file.
|
Where `filename1` is the source path to the file and `filename2` is the destination path to the file.
|
||||||
|
|
||||||
### p. `rm`
|
### q. `rm`
|
||||||
Removes a file. Using this command on a directory gives you an error.
|
Removes a file. Using this command on a directory gives you an error.
|
||||||
`rm: directory: is a directory`
|
`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.
|
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.
|
||||||
@ -221,13 +231,13 @@ To remove a directory you have to pass `-r` which will remove the content of the
|
|||||||
rm filename
|
rm filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### q. `tail`
|
### r. `tail`
|
||||||
Outputs the last 10 lines of file. Use `-f` to output appended data as the file grows.
|
Outputs the last 10 lines of file. Use `-f` to output appended data as the file grows.
|
||||||
```bash
|
```bash
|
||||||
tail filename
|
tail filename
|
||||||
```
|
```
|
||||||
|
|
||||||
### r. `touch`
|
### s. `touch`
|
||||||
Creates or updates your file.
|
Creates or updates your file.
|
||||||
```bash
|
```bash
|
||||||
touch filename
|
touch filename
|
||||||
@ -237,17 +247,6 @@ Example:
|
|||||||
$ touch trick.md
|
$ touch trick.md
|
||||||
```
|
```
|
||||||
|
|
||||||
### s. `find`
|
|
||||||
Find files in directory
|
|
||||||
```bash
|
|
||||||
find directory options pattern
|
|
||||||
```
|
|
||||||
Example:
|
|
||||||
```bash
|
|
||||||
$ find . -name README.md
|
|
||||||
$ find /home/user1 -name '*.png'
|
|
||||||
```
|
|
||||||
|
|
||||||
## 1.2. Text Operations
|
## 1.2. Text Operations
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
Loading…
Reference in New Issue
Block a user