linux:fileoperation
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
linux:fileoperation [2016/06/07 10:41] – created admin | linux:fileoperation [2016/06/07 10:47] (current) – admin | ||
---|---|---|---|
Line 9: | Line 9: | ||
find / -name yourdirectory -type d | find / -name yourdirectory -type d | ||
</ | </ | ||
- | c) Find File on Linux and execute | + | c) Find File on Linux and execute |
<code bash> | <code bash> | ||
find / -name yourfile -exec rm {} \; | find / -name yourfile -exec rm {} \; | ||
</ | </ | ||
- | d) Find Directory on Linux and execute | + | d) Find Directory on Linux and execute |
<code bash> | <code bash> | ||
find / -name yourdirectory -type d -exec rm {} \; | find / -name yourdirectory -type d -exec rm {} \; | ||
Line 26: | Line 26: | ||
updatedb | updatedb | ||
slocate yourfiles | slocate yourfiles | ||
+ | </ | ||
+ | **Create an empty File on Linux** | ||
+ | |||
+ | a) Create an empty file | ||
+ | <code bash> | ||
+ | touch yourfile | ||
+ | </ | ||
+ | |||
+ | **Remove File or directory on Linux** | ||
+ | |||
+ | a) Remove File on Linux | ||
+ | <code bash> | ||
+ | rm yourfile | ||
+ | </ | ||
+ | a) Remove Directory on Linux, -f Force, -R Recursively | ||
+ | <code bash> | ||
+ | rm -fR yourdirectory | ||
+ | </ | ||
+ | |||
+ | **List File or directory on Linux** | ||
+ | |||
+ | a) List File or Directory on Linux | ||
+ | <code bash> | ||
+ | ls | ||
</ | </ |
linux/fileoperation.1465288864.txt.gz · Last modified: 2016/06/07 10:41 by admin