perlnote7

#!/usr/bin/perl -w

use strict;

=head 

this section describes file system;

=cut

=head1

1 test operators 

2 built-in subroutines 

chdir "directory" or die "$!"; 

chdir; === cd $HOME;  

chmod umask, @filename; 

chmod 0777, "./lzc"; 

 chown uid, gid, @files;  

@arr = glob "*.pl"; === @arr = <*.pl>; === ls *.pl;        

@arr = <FH/*>; # glob;    

@arr = <FH>; # read from File Handle;    

$name = "FD"; @arr = <$name>; read from File Handle;    $name = "FD", @arr = <$name/*>; glob  link "src", "dest"; === ln src, dest (hard link)  mkdir path, umask; === in shell, mkdir path; chmod umask path;  rename oldname, newname;  rmdir dir; dir NOT @dir, success if dir is empty;  unlink @arr; unlink glob "dir/*"; unlink @_ or die $!; ONLY del files;  utime atime, mtime, @files; ctime is always the "now" time;Cannot modified;  @t = localtime(timestamp); or we can use it in a readable way:  ($sec, $min, $hour, $day, $mon, $year, $wday, $yday, $isdat) = localtime(t);  @status = stat|lstat filename; also we can use in a more explicit way:  ($dev_id, $inode_id, $mode, $num_of_ln, $uid, $gid, $rdev, $size,    $atime, $mtime, $ctime, $blksize, $blocks) = stat filename;=cutprint "1. ls * /n";print "$_/n" for (<*>); # no need "*"rmdir $_ for glob "./dir*"; # rmdir ONLY remove one empty dir per time;mkdir "./lzcdir";print "2. ls -d * /n";for (glob "*") {    print "$_/n" if (-d $_);}print "3. chmod 777 *.pl /n";chmod 0777, <*.pl>; # no need of "" in <>;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值