Linux Common basic Commands (File,chown)

Source: Internet
Author: User

1,file command function, view the type of file

[Email protected]:~$dirname./linux/rename/1. htm./linux/Rename[email protected]:~$file./linux/rename/1. htm./linux/rename/1. Htm:empty[email protected]:~$Echo 'This is a HTML file'>./linux/rename/1. htm [email protected]:~$file./linux/rename/1. htm./linux/rename/1. Htm:ascii text[email protected]:~$which ls/bin/ls[email protected]:~$file/bin/ls/bin/ls: ELF --bit LSB executable, x86- -, version1(SYSV), dynamically linked, interpreter/lib64/LD-linux-x86- -. So.2, forGnu/linux2.6. +, buildid[sha1]=d0bc0fb9b3f60f72bbad3c5a1d24c9e2a1fde775, Stripped[email protected]:~$file./python/ for. py func3.py func5.py global2.py while1.py func2.py func4.py func.py global.py while. py [email protected]:~$file./python/ for. py./python/ for. Py:ascii text[email protected]:~$file./python/./python/: Directory

2,chown: User and user groups that change files or directories

Usage: chown [option] [Owner]:[group] [file]

Attention:

: Can be used instead of

> Users and groups to be real

Common parameters:-r, recursively modify directory Users and user groups

Delete the two-character file that ends with. html, leaving fewer files, and better looking results

[Email protected]:~/linux/rename$ls -. htm +. htm -. htmPanax Notoginseng. htm $. htm -. htm -. htm the. htm the. htm the. htmTen. htm1. htm in. htm -. htm -. htm About. htm $. htm About. htm the. htm the. htm One. htm -. htm2. htm the. htm -. htm $. htm the. htm the. htm -. htm the. htm A. htm +. htm -. htm3. htm the. htm -. htm the. htm the. htm -. htm94. htm -. htm A. htm to. htm +. htm4. htm -. htm the. htm the. htm the. htm the. htm -. htm at. htm +. htm A. htm -. htm5. htm the. htm +. htm the. htm the. htm the. htm -. htm -. htm the. htmWuyi. htm -. htm6. htm -. htm the. htm the. htm -. htm -. htm the. htm +. htm the. htm A. htm -. htm7. htm the. htm98. htm -. htm -. htm *. htm -. htm -. htm +. htm in. htm the. htm8. htm About. htm -. htm -. htm $. htm $. htm Wu. htm the. htm the. htmBayi. htm -. htm9. Htm[email protected]:~/linux/rename$Find. -name"??. HTM"|Xargs RM[email protected]:~/linux/rename$ls -. htm1. htm2. htm3. htm4. htm5. htm6. htm7. htm8. htm9. htm

2, changing users and groups requires root privileges

[Email protected]:/home/ghostwu/linux/rename#ls-Ltotal4-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: -  -. htm-rw-rw-r--1GHOSTWU GHOSTWU -May8  A: the 1. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 2. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 3. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 4. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 5. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 6. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 7. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 8. htm-rw-rw-r--1GHOSTWU GHOSTWU0May8  A: - 9. Htm[email protected]:/home/ghostwu/linux/rename#ChownRoot.root1. htm [email protected]:/home/ghostwu/linux/rename#ls-L1. htm-rw-rw-r--1Root root -May8  A: the 1. Htm[email protected]:/home/ghostwu/linux/rename#ChownRoot:root2. Htm[email protected]:/home/ghostwu/linux/rename#ls-L2. htm-rw-rw-r--1Root root0May8  A: - 2. Htm[email protected]:/home/ghostwu/linux/rename#mkdir-P A/{b,c}[email protected]:/home/ghostwu/linux/rename# Tree Aa├──b└──c2Directories,0Files[email protected]:/home/ghostwu/linux/rename#MansTree[email protected]:/home/ghostwu/linux/rename# Tree-ug Aa├──[root root] b└──[root root] c2Directories,0Files[email protected]:/home/ghostwu/linux/rename#Chown-R GHOSTWU.GHOSTWU a[email protected]:/home/ghostwu/linux/rename# Tree-ug Aa├──[ghostwu GHOSTWU] B└──[GHOSTWU GHOSTWU] C2Directories,0Files[email protected]:/home/ghostwu/linux/rename#ls-LDADRWXR-xr-x4GHOSTWU GHOSTWU4096May8  at: onA[email protected]:/home/ghostwu/linux/rename#

Linux Common basic Commands (File,chown)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.