热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

27.3.DirectoryandFileSystemRelated

27.3.1.dirname$dirnameusrbinfindusrbin27.3.2.filename$basenameusrbinfindfind27.3.2.1.排除扩

27.3.1. dirname

$ dirname /usr/bin/find
/usr/bin

27.3.2. filename

$ basename /usr/bin/find
find

27.3.2.1. 排除扩展名

file=test.txt
b=${file%.*}
echo $b

$ for file in *.JPG;do mv $file ${file%.*}.jpg;done

27.3.2.2. 取扩展名

file=test.txt
b=${file##*.}
echo $b

27.3.3. test - check file types and compare values


test -x /usr/bin/munin-cron && /usr/bin/munin-cron

27.3.4. file — determine file type

$ file mis.netkiller.cn-0.0.1.war
mis.netkiller.cn-0.0.1.war: Zip archive data, at least v2.0 to extract$ file dian_icon.png
dian_icon.png: PNG image data, 8 x 24, 8-bit/color RGBA, non-interlaced$ file sms-s3.jpg
sms-s3.jpg: JPEG image data, JFIF standard 1.01$ file -i favicon.ico
favicon.ico: image/x-icon; charset=binary$ file netkiller.wmv
netkiller.wmv: Microsoft ASF$ file netkiller.flv
netkiller.flv: Macromedia Flash Video$ file neo.swf
neo.swf: Macromedia Flash data (compressed), version 10$ file cs800.css
cs800.css: ISO-8859 text, with CRLF line terminators

查看mime

$ file -i sms.jpg
sms.jpg: image/jpeg; charset=binary$ file -i call.png
call.png: image/png; charset=binary$ file -i cs800.css
cs800.css: text/plain; charset=iso-8859-1$ file -i neo.swf
neo.swf: application/x-shockwave-flash; charset=binary$ file -i neo.wmv
neo.wmv: video/x-ms-asf; charset=binary$ file -i neo.flv
neo.flv: video/x-flv; charset=binary

27.3.5. stat

modification time(mtime,修改时间):当该文件的“内容数据”更改时,会更新这个时间。内容数据指的是文件的内容,而不是文件的属性。
status time(ctime,状态时间):当该文件的”状态(status)”改变时,就会更新这个时间,举例,更改了权限与属性,就会更新这个时间。
access time(atime,存取时间):当“取用文件内容”时,就会更新这个读取时间。举例来使用cat去读取该文件,就会更新atime了。

[root@apache www]# stat index.htmlFile: `index.html'Size: 145355 Blocks: 296 IO Block: 4096 regular file
Device: fd01h/64769d Inode: 15861815 Links: 1
Access: (0755/-rwxr-xr-x) Uid: ( 502/ upuser) Gid: ( 502/ upuser)
Access: 2010-10-28 11:09:52.000000000 +0800
Modify: 2010-10-28 10:23:13.000000000 +0800
Change: 2010-10-28 10:23:13.000000000 +0800

27.3.6. mkdir - make directories

mkdir -p /tmp/test/{aaa,bbb,ccc,ddd}mkdir -p /tmp/test/{aaa,bbb,ccc,ddd}/{eee,fff}mkdir -p /tmp/test/{2008,2009,2010,2011}/{01,02,03,04,05,06,07,08,09,10,11,12}/{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30}

27.3.7. rename

批量更改扩展名

rename 's/\.png/\.PNG/' *.pngrename '/\.mp3/\.MP3/' *.mp3
rename .mp3 .MP3 *.mp3rename GIF gif *.GIF

for file in *.GIF
domv $file ${file%.*}.gif
done

$ mkdir chapter.command.xxx.xml
$ mkdir chapter.command.bbb.xml
$ mkdir chapter.command.ccc.xml
$ mkdir chapter.command.ddd.xml$ rename 's/command/cmd/' *.command.*.xml

27.3.8. touch

创建空文件,修改文件日期时间

touch [-acdmt] 文件
参数:
-a : 仅修改access time。
-c : 仅修改时间,而不建立文件。
-d : 后面可以接日期,也可以使用 --date="日期或时间"
-m : 仅修改mtime。
-t : 后面可以接时间,格式为 [YYMMDDhhmm]# touch filename
# touch -d 20050809 filename
# touch -t 0507150202 bashrc
# touch -d "2 days ago" bashrc
# touch --date "2011-06-03" filename

27.3.9. truncate

truncate - shrink or extend the size of a file to the specified size

创建指定大小的文件

truncate -s 1k /tmp/test.txt
truncate -s 100m /tmp/test100.txt

27.3.10. ls - list directory contents

$ ls
$ ls ~
$ ls -l
$ ls -a
$ ls -1
$ ls -F
bg7nyt.txt* Desktop/ Firefox_wallpaper.png Music/ public_html@ Videos/
bg7nyt.wav* Documents/ Mail/ nat.txt* script/ workspace/
BOINC/ Examples@ mbox Pictures/ Templates/

{}通配符

ls {*.py,*.php,*.{sh,shell}}

take a look at below

alias l='ls -CF'
alias la='ls -A'
alias ll='ls -l'
alias ls='ls --color=auto'

27.3.10.1. full-time / time-style 定义日期时间格式

默认风格

[www@www.netkiller.cn ~]$ ls -l /var/log/message*
-rw------- 1 root root 302533 Jun 18 09:50 /var/log/messages
-rw------- 1 root root 392028 May 23 03:30 /var/log/messages-20160523
-rw------- 1 root root 334328 May 29 03:09 /var/log/messages-20160529
-rw------- 1 root root 395792 Jun 5 03:44 /var/log/messages-20160605
-rw------- 1 root root 308984 Jun 13 03:33 /var/log/messages-20160613

修改后

--full-time = --time-style=full-iso

[www@www.netkiller.cn ~]$ ls -l --full-time /var/log/messages*
-rw------- 1 root root 308659 2016-06-18 10:24:49.186979051 +0800 /var/log/messages
-rw------- 1 root root 392028 2016-05-23 03:30:01.869219181 +0800 /var/log/messages-20160523
-rw------- 1 root root 334328 2016-05-29 03:09:02.158442470 +0800 /var/log/messages-20160529
-rw------- 1 root root 395792 2016-06-05 03:44:02.424073354 +0800 /var/log/messages-20160605
-rw------- 1 root root 308984 2016-06-13 03:33:02.004785063 +0800 /var/log/messages-20160613[www@www.netkiller.cn ~]$ ls -l --time-style=full-iso /var/log/messages*
-rw------- 1 root root 308659 2016-06-18 10:24:49.186979051 +0800 /var/log/messages
-rw------- 1 root root 392028 2016-05-23 03:30:01.869219181 +0800 /var/log/messages-20160523
-rw------- 1 root root 334328 2016-05-29 03:09:02.158442470 +0800 /var/log/messages-20160529
-rw------- 1 root root 395792 2016-06-05 03:44:02.424073354 +0800 /var/log/messages-20160605
-rw------- 1 root root 308984 2016-06-13 03:33:02.004785063 +0800 /var/log/messages-20160613

long-iso

[www@www.netkiller.cn ~]$ ls -lh --time-style long-iso /var/log/message*
-rw------- 1 root root 296K 2016-06-18 10:00 /var/log/messages
-rw------- 1 root root 383K 2016-05-23 03:30 /var/log/messages-20160523
-rw------- 1 root root 327K 2016-05-29 03:09 /var/log/messages-20160529
-rw------- 1 root root 387K 2016-06-05 03:44 /var/log/messages-20160605
-rw------- 1 root root 302K 2016-06-13 03:33 /var/log/messages-20160613

通过配置 TIME_STYLE 环境变量,改变日期格式

[www@www.netkiller.cn ~]$ export TIME_STYLE=long-iso[www@www.netkiller.cn ~]$ ls -l /var/log/message*
-rw------- 1 root root 302533 2016-06-18 09:50 /var/log/messages
-rw------- 1 root root 392028 2016-05-23 03:30 /var/log/messages-20160523
-rw------- 1 root root 334328 2016-05-29 03:09 /var/log/messages-20160529
-rw------- 1 root root 395792 2016-06-05 03:44 /var/log/messages-20160605
-rw------- 1 root root 308984 2016-06-13 03:33 /var/log/messages-20160613[www@www.netkiller.cn ~]$ export TIME_STYLE=iso
[www@www.netkiller.cn ~]$ ls -l /var/log/message*
-rw------- 1 root root 302533 06-18 09:50 /var/log/messages
-rw------- 1 root root 392028 05-23 03:30 /var/log/messages-20160523
-rw------- 1 root root 334328 05-29 03:09 /var/log/messages-20160529
-rw------- 1 root root 395792 06-05 03:44 /var/log/messages-20160605
-rw------- 1 root root 308984 06-13 03:33 /var/log/messages-20160613

自定义格式

[www@www.netkiller.cn ~]$ ls -l --time-style="+%Y-%m-%d" /var/log/message*
-rw------- 1 root root 302533 2016-06-18 /var/log/messages
-rw------- 1 root root 392028 2016-05-23 /var/log/messages-20160523
-rw------- 1 root root 334328 2016-05-29 /var/log/messages-20160529
-rw------- 1 root root 395792 2016-06-05 /var/log/messages-20160605
-rw------- 1 root root 308984 2016-06-13 /var/log/messages-20160613[root@www.netkiller.cn ~]# export TIME_STYLE='+%Y/%m/%d %H:%M:%S'
[root@www.netkiller.cn ~]# ls -l /var/log/messages*
-rw------- 1 root root 189352 2016/06/18 10:20:01 /var/log/messages
-rw------- 1 root root 322453 2016/05/22 03:48:02 /var/log/messages-20160522
-rw------- 1 root root 247398 2016/05/30 03:37:01 /var/log/messages-20160530
-rw------- 1 root root 174633 2016/06/05 03:14:02 /var/log/messages-20160605
-rw------- 1 root root 196728 2016/06/12 03:17:01 /var/log/messages-20160612

27.3.11. cp - copy files and directories

27.3.11.1. copy directories recursively

cp -r /etc/* ~/myetc

27.3.11.2. overwrite an existing file

# alias cp
alias cp='cp -i'# unalias cp
# alias cp
-bash: alias: cp: not found

27.3.11.3. -a, --archive same as -dR --preserve=all

# cp -a file file2

-a 参数可以保留原文件的日期与权限等等信息。

# ll
-rw-r--r--. 1 root root 2559 Aug 27 05:00 yum.sh# cp -a yum.sh yum1.sh
# cp yum.sh yum2.sh# ll yum*
-rw-r--r--. 1 root root 2559 Aug 27 05:00 yum1.sh
-rw-r--r--. 1 root root 2559 Aug 27 05:58 yum2.sh
-rw-r--r--. 1 root root 2559 Aug 27 05:00 yum.sh

现在可以看到 yum1.sh 与 yum.sh 日期是相同的,而没有实现-a参数的 yum2.sh 日期为当前日期。

27.3.12. rm - remove files or directories

27.3.12.1. -bash: /bin/rm: Argument list too long

ls -1 | xargs rm -f
find . -name 'spam-*' | xargs rm
find . -exec rm {} \;ls | xargs -n 10 rm -fr # 10个为一组

27.3.12.2. zsh: sure you want to delete all the files in /tmp [yn]?

yes | rm -i file

27.3.13. df - report file system disk space usage

neo@netkiller:~$ df -lh
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 19G 3.1G 15G 17% /
none 996M 224K 996M 1% /dev
none 1000M 0 1000M 0% /dev/shm
none 1000M 520K 1000M 1% /var/run
none 1000M 0 1000M 0% /var/lock
none 1000M 0 1000M 0% /lib/init/rw
/dev/sda6 19G 13G 4.5G 75% /home
/dev/sda10 556M 178M 351M 34% /boot
/dev/sda7 46G 4.4G 40G 10% /var
/dev/sda8 367G 60G 289G 18% /opt
/dev/sda9 6.5G 143M 6.0G 3% /tmp

27.3.14. du - estimate file space usage

neo@netkiller:~$ sudo du -sh /usr/local
63M /usr/local

27.3.15. tac - concatenate and print files in reverse

$ tac /etc/issue
Kernel \r on an \m
CentOS release 5.4 (Final)

27.3.16. split - split a file into pieces

27.3.16.1. 按行分割文件

-l, --lines=NUMBER put NUMBER lines per output file

每10000行产生一个新文件

# split -l 10000 book.txt myfile

27.3.16.2. 按尺寸分割文件

-b, --bytes=SIZE put SIZE bytes per output file

下面的例子是每10兆分割为一个新文件

split -b 10m large.bin new_file_prefix

27.3.17. find - search for files in a directory hierarchy

27.3.17.1. name

Find every file under directory /usr ending in "stat".

$ find /usr -name *stat
/usr/src/linux-headers-2.6.24-22-generic/include/config/cpu/freq/stat
/usr/bin/lnstat
/usr/bin/sar.sysstat
/usr/bin/mpstat
/usr/bin/rtstat
/usr/bin/nstat
/usr/bin/lpstat
/usr/bin/ctstat
/usr/bin/stat
/usr/bin/kpsestat
/usr/bin/pidstat
/usr/bin/iostat
/usr/bin/vmstat
/usr/lib/sysstat
/usr/share/doc/sysstat
/usr/share/gnome/help/battstat
/usr/share/omf/battstat
/usr/share/zsh/help/stat
/usr/share/zsh/4.3.4/functions/Completion/Unix/_diffstat
/usr/share/zsh/4.3.4/functions/Completion/Zsh/_stat
/usr/share/zsh/4.3.4/functions/Zftp/zfstat

find \( -iname '*.jpg' -o -iname '*.png' -o -iname '*.gif' \)find /www/images -type f \( -iname '*.js' -o -iname '*.css' -o -iname '*.html' \) | xargs tar -czf ~/images.tgz

使用通配符

find . -name "*.jsp" -delete
find . -name "*.xml" -delete

27.3.17.2. regex

find . -regex ".*\.\(jpg\|png\)"

下面regex与name作用相同

find . -regex ".*\.\(txt\|sh\)"
find . -name "*.sh" -o -name "*.txt"

-regex参数,使用正则表达式来匹配. 查找当前目录以及子目录中以 ".sh",并改为以".shell"结尾.


[neo@netkiller test]# tree a
a
├── a.py
├── a.sh
└── b├── b.py├── b.sh├── c│ └── c.sh└── d└── d.sh[neo@netkiller test]# find ./a -type f -regex ".*\.sh$" | sed -r -n 's#(.*\.)sh$#mv & \1shell#e'
[neo@netkiller test]# tree a
a
├── a.py
├── a.shell
└── b├── b.py├── b.shell├── c│ └── c.shell└── d└── d.shell// 注意 sed s->e 使用方式,官方文档是这样解释的.
This command allows one to pipe input from a shell command into pattern space. If a substitution was made, the command that is found in pattern space is executed and pattern space is replaced with its output. A trailing newline is suppressed; results are undefined if the command to be executed contains a NUL character. This is a GNU sed extension.

27.3.17.3. user

Find every file under /home and /var/www owned by the user neo.

$ find /home -user neo
$ find /var/www -user neo
$ find . -user nobody -iname '*.php'

27.3.17.4. perm

find ./ -perm -7 -print | xargs chmod o-w
find . -perm -o=w

查找当前目录下权限为777的文件并显示到标准输出

find ./ -type f -perm 777 -print

27.3.17.5. type

27.3.17.5.1. 分别设置文件与目录的权限

find /usr/www/phpmyadmin -type d -exec chmod 755 {} \;
find /usr/www/phpmyadmin -type f -exec chmod 644 {} \;

27.3.17.6. -delete

# find /var/spool/clientmqueue/ -type f -delete

保留最近7天的问题,其他全部删除

find . -type f -mtime +7 -delete

27.3.17.7. exec

替换文本

# find ./ -exec grep str1 ‘{}’ \; -exec sed -i.bak s/str1/str2/g ‘{}’ \;

find -exec ls -l {} \; | grep '2011-01-18'

查找*.html文件中aaa替换为bbb

find . -name "*.html" -type f -exec sed -i "s/aaa/bbb/" {} \;

查找文件中含有openWindow字符串的文件

# find -type f -name "*.js" -exec grep -H -A2 openWindow {} \;./Javascript/commonjs.js:function openWindow(url){
./Javascript/commonjs.js- window.open(url + "?rand=" + getRandom(), 'gamebinary');
./Javascript/commonjs.js-}

find -type f -regex ".*\.\(css\|js\)" -exec yuicompressor {} -o {} \;
find -type f -name "*.js" -exec yuicompressor --type js {} -o {} \;
find -type f -name "*.css" -exec yuicompressor --type css {} -o {} \;

27.3.17.8. 排除目录

find /usr/local -path "/usr/local/share" -prune -o -printfind /usr/local \( -path /usr/local/bin -o -path /usr/local/sbin \) -prune -o -printfind /usr/local \(-path /usr/local/dir1 -o -path /usr/local/file1 \) -prune -o -name "temp" -print

查找当前目录下的php文件,排除子目录templates_c, caches

find . \( -path ./templates_c -o -path ./caches \) -prune -o -name "*.php" -print

27.3.17.9. -mmin n File's data was last modified n minutes ago.

# find . -mmin +5 -mmin -10

find /www -type f -mtime +60s

27.3.17.10. -ctime

查找当前目录下超过6天且是空文件并删除

find ./ -type d -empty -ctime +6 -exec rm -f {} \;

查找7天前的文件并删除

find /backup/svn/day -type f -ctime +7 -exec rm -f {} \;
find /backup/svn/day -type f -ctime +7 -delete
find /backup/svn/day -type f -ctime +7 | xargs rm -f

27.3.17.11. -mtime / -mmin

查询最近3天前内修改的文件

find . -type f -mtime -3

3天前

find . -type f -mtime +3

例 27.1. backup(find + tar)

find / -type f -mtime -7 | xargs tar -rf weekly_incremental.tar
gzip weekly_incremental.tar


保留7天,删除7天的日志文件

COPIES=7
find /var/log -type f -mtime +$COPIES -delete

27.3.17.12. --newer

tar --newer="2011-07-04" -zcvf backup.tar.gz /var/www/
tar cvzf foo.tgz /bak -N "2004-03-03 16:49:17"

27.3.17.13. -print / -printf

[root@scientific ~]# find / -maxdepth 1 -name '[!.]*' -printf 'Name: %16f Size: %6s\n'
Name: / Size: 4096
Name: misc Size: 0
Name: media Size: 4096
Name: home Size: 4096
Name: dev Size: 3840
Name: net Size: 0
Name: proc Size: 0
Name: sbin Size: 12288
Name: root Size: 4096
Name: lib Size: 4096
Name: cgroup Size: 4096
Name: srv Size: 4096
Name: mnt Size: 4096
Name: etc Size: 12288
Name: usr Size: 4096
Name: lib64 Size: 12288
Name: boot Size: 1024
Name: var Size: 4096
Name: selinux Size: 0
Name: opt Size: 4096
Name: tmp Size: 4096
Name: lost+found Size: 16384
Name: sys Size: 0
Name: bin Size: 4096# find /etc/ -type f -printf "%CY-%Cm-%Cd %Cr %8s %f\n"

27.3.17.14. -size

查找0字节文件

find /www -type f -size 0

查找根目录下大于1G的文件

find / -type f -size +1000M

27.3.17.15. -path

搜索当前目录下除了keys目录下所以子目录中的文件

find ./ -path "./keys" -prune -o -type f -print

find排除多个目录

find ./ \( -path ./conf -o -path ./logs \) -prune -o -printfind /data/ \( -path /data/data_backup -o -path /data/mysql \) -prune -o -name "core.*" -type f
/data/mysql
/data/data_backup

ps 要么都是绝对路径 要么都是相对路径 /data/ 必须有"/" path 后面的路径必须没有"/"

27.3.17.16. -maxdepth

-maxdepth和-mindepth,最大深度,最小深度搜索,搜索当前目录下最大深度为1的所以文件

find . -maxdepth 1 -type f

27.3.17.17. xargs

find /etc -type f|xargs md5sum

sha1sum

find /etc -type f|xargs sha1sum

find ./ -name "*html" | xargs -n 1 sed -i -e 's/aaa/bbb/g'

find /tmp -name core -type f -print | xargs /bin/rm -f
find . -type f -exec file '{}' \;

find后执行xargs提示xargs: argument line too long解决方法:

find . -type f -name "*.log" -print0 | xargs -0 rm -f




原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。



推荐阅读
  • 本文介绍了在开发Android新闻App时,搭建本地服务器的步骤。通过使用XAMPP软件,可以一键式搭建起开发环境,包括Apache、MySQL、PHP、PERL。在本地服务器上新建数据库和表,并设置相应的属性。最后,给出了创建new表的SQL语句。这个教程适合初学者参考。 ... [详细]
  • 本文介绍了设计师伊振华受邀参与沈阳市智慧城市运行管理中心项目的整体设计,并以数字赋能和创新驱动高质量发展的理念,建设了集成、智慧、高效的一体化城市综合管理平台,促进了城市的数字化转型。该中心被称为当代城市的智能心脏,为沈阳市的智慧城市建设做出了重要贡献。 ... [详细]
  • android listview OnItemClickListener失效原因
    最近在做listview时发现OnItemClickListener失效的问题,经过查找发现是因为button的原因。不仅listitem中存在button会影响OnItemClickListener事件的失效,还会导致单击后listview每个item的背景改变,使得item中的所有有关焦点的事件都失效。本文给出了一个范例来说明这种情况,并提供了解决方法。 ... [详细]
  • XML介绍与使用的概述及标签规则
    本文介绍了XML的基本概念和用途,包括XML的可扩展性和标签的自定义特性。同时还详细解释了XML标签的规则,包括标签的尖括号和合法标识符的组成,标签必须成对出现的原则以及特殊标签的使用方法。通过本文的阅读,读者可以对XML的基本知识有一个全面的了解。 ... [详细]
  • 本文介绍了Linux Shell中括号和整数扩展的使用方法,包括命令组、命令替换、初始化数组以及算术表达式和逻辑判断的相关内容。括号中的命令将会在新开的子shell中顺序执行,括号中的变量不能被脚本余下的部分使用。命令替换可以用于将命令的标准输出作为另一个命令的输入。括号中的运算符和表达式符合C语言运算规则,可以用在整数扩展中进行算术计算和逻辑判断。 ... [详细]
  • This article discusses the efficiency of using char str[] and char *str and whether there is any reason to prefer one over the other. It explains the difference between the two and provides an example to illustrate their usage. ... [详细]
  • 本文由编程笔记#小编整理,主要介绍了关于数论相关的知识,包括数论的算法和百度百科的链接。文章还介绍了欧几里得算法、辗转相除法、gcd、lcm和扩展欧几里得算法的使用方法。此外,文章还提到了数论在求解不定方程、模线性方程和乘法逆元方面的应用。摘要长度:184字。 ... [详细]
  • Activiti7流程定义开发笔记
    本文介绍了Activiti7流程定义的开发笔记,包括流程定义的概念、使用activiti-explorer和activiti-eclipse-designer进行建模的方式,以及生成流程图的方法。还介绍了流程定义部署的概念和步骤,包括将bpmn和png文件添加部署到activiti数据库中的方法,以及使用ZIP包进行部署的方式。同时还提到了activiti.cfg.xml文件的作用。 ... [详细]
  • 自动轮播,反转播放的ViewPagerAdapter的使用方法和效果展示
    本文介绍了如何使用自动轮播、反转播放的ViewPagerAdapter,并展示了其效果。该ViewPagerAdapter支持无限循环、触摸暂停、切换缩放等功能。同时提供了使用GIF.gif的示例和github地址。通过LoopFragmentPagerAdapter类的getActualCount、getActualItem和getActualPagerTitle方法可以实现自定义的循环效果和标题展示。 ... [详细]
  • Android系统移植与调试之如何修改Android设备状态条上音量加减键在横竖屏切换的时候的显示于隐藏
    本文介绍了如何修改Android设备状态条上音量加减键在横竖屏切换时的显示与隐藏。通过修改系统文件system_bar.xml实现了该功能,并分享了解决思路和经验。 ... [详细]
  • 本文介绍了OpenStack的逻辑概念以及其构成简介,包括了软件开源项目、基础设施资源管理平台、三大核心组件等内容。同时还介绍了Horizon(UI模块)等相关信息。 ... [详细]
  • 本文介绍了在Mac上安装Xamarin并使用Windows上的VS开发iOS app的方法,包括所需的安装环境和软件,以及使用Xamarin.iOS进行开发的步骤。通过这种方法,即使没有Mac或者安装苹果系统,程序员们也能轻松开发iOS app。 ... [详细]
  • Android工程师面试准备及设计模式使用场景
    本文介绍了Android工程师面试准备的经验,包括面试流程和重点准备内容。同时,还介绍了建造者模式的使用场景,以及在Android开发中的具体应用。 ... [详细]
  • 本文介绍了使用哈夫曼树实现文件压缩和解压的方法。首先对数据结构课程设计中的代码进行了分析,包括使用时间调用、常量定义和统计文件中各个字符时相关的结构体。然后讨论了哈夫曼树的实现原理和算法。最后介绍了文件压缩和解压的具体步骤,包括字符统计、构建哈夫曼树、生成编码表、编码和解码过程。通过实例演示了文件压缩和解压的效果。本文的内容对于理解哈夫曼树的实现原理和应用具有一定的参考价值。 ... [详细]
  • 在2022年,随着信息化时代的发展,手机市场上出现了越来越多的机型选择。如何挑选一部适合自己的手机成为了许多人的困扰。本文提供了一些配置及性价比较高的手机推荐,并总结了选择手机时需要考虑的因素,如性能、屏幕素质、拍照水平、充电续航、颜值质感等。不同人的需求不同,因此在预算范围内找到适合自己的手机才是最重要的。通过本文的指南和技巧,希望能够帮助读者节省选购手机的时间。 ... [详细]
author-avatar
VE5851_325
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有