Content Summary:
1. Several commands related to the directory
mkdir Follow-p option
RmDir also has a-p option
Rm-r-F Two common options
Cp-r for catalogs, sometimes we use/BIN/CP
MV Rename or move, sometimes we use/BIN/MV, when we are in the MV directory, note that if the target directory exists, then the source directory will be moved to the target directory
2. Text-related commands
Cat-n Display Line numbers
Tac
More
Less
Less/var/log/messages can search for keywords/start press n down to find
Head-n default display starts 10 lines
Tail-n-F Displays the last 10 rows by default
/etc/rc.d/rc.local
Date-s "21:30:30"
Date-s "2015-06-29"
3. Properties of the file or directory
belongs to the main, genus group
Type D,-, C, B, L, S, p----------- directory normal file character Charact er block block Soft connection link data structure structures piping pipe
Permissions rwx
Inode Index node
4. Change Permissions
chown Change the owner, owning group
chmod change rwx permissions
umask Specify default permissions, directory 755 file 644, directory without execute permission, I We cannot CD into this directory, but can ls this directory
chattr (-a -i +a +i) filename Special Permissions (Modify special permissions) a can only append i cannot change
lsattr (view special permissions)
[[email protected] sundong]# chattr + A zk/1.txt
[[email protected] sundong]# lsattr
-------------E./zhangkun
-------------E./zk
-------------E./mayang
------ -------E./mz.tar
[[email protected] sundong]# cd ZK
[[email protected] zk]# lsattr
-----a-------E./1.txt
[email protected] sd]# Echo 123 >> 4.txt
[email protected] sd]# cat 4.txt
123
[email protected] sd]#
>> is additional content
> is covering the original content
Redirection and piping in Linux
http://blog.csdn.net/songyang516/article/details/6758256
5. Search for documents
which
Whereis
Yum Install-y mlocate
UpdateDB
Locate 1.txt
Find/-name messages
/var/log/messages
/etc/vmware-tools/messages
Find/-type b-name ' sd* '
/dev/sda3
/dev/sda2
/dev/sda1
/dev/sda
Find-type-name-mtime-atime-ctime
Stat command to view three time
6. link files under Linux
ln
Soft Connection Hard Connection
The options that LN uses are a '-s ', and if not, create a hard link, plus a soft link.
Extension: 1. The difference between/DEV/SHM and swap http://www.aminglinux.com/bbs/thread-7646-1-1.html
/dev/shm/
One thing to be aware of is the capacity issue, under Linux, which defaults to half the size of memory, using the DF-H command to see
Swap
And swap is the virtual memory of Linux, that is, to open up space on the hard disk when memory is not enough to use as memory, it can be understood as when the/dev/shm space is not enough to occupy swap space. Use Cat/proc/swaps to view
2. Specify the difference between buffer and cache http://www.apelearn.com/bbs/forum.php?mod=viewthread&tid=117&highlight=buffer%2B% 2Bcache
Both are data in RAM. In a nutshell, buffer is about to be written to disk, and the cache is read from disk.
2015-03-16/2015-03-18linux Directory file Management