{"id":18859781,"url":"https://github.com/sty945/diy_bash","last_synced_at":"2025-04-14T12:21:18.639Z","repository":{"id":109499713,"uuid":"128282707","full_name":"sty945/DIY_Bash","owner":"sty945","description":"To promote your work effiency by using this DIY_bash's files","archived":false,"fork":false,"pushed_at":"2023-11-09T08:15:56.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T01:26:23.920Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sty945.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-06T01:15:02.000Z","updated_at":"2023-11-09T07:55:35.000Z","dependencies_parsed_at":"2024-11-08T04:19:35.355Z","dependency_job_id":"7dc89e87-9658-4a0e-b752-6a8245bb6379","html_url":"https://github.com/sty945/DIY_Bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2FDIY_Bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2FDIY_Bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2FDIY_Bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sty945%2FDIY_Bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sty945","download_url":"https://codeload.github.com/sty945/DIY_Bash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248877968,"owners_count":21176244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T04:19:12.217Z","updated_at":"2025-04-14T12:21:18.546Z","avatar_url":"https://github.com/sty945.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![MIT](https://img.shields.io/cocoapods/l/AFNetworking.svg)](https://github.com/sty945/DIY_Bash/blob/master/LICENSE)\n\n# 目的\n通过自己编写的脚本实现Linux系统不自带的功能，来提高工作效率。\n\n欢迎大家fork一起来完善更多的功能，如果觉得还不错的欢迎点个star.\n\n# 具体功能介绍\n**sort_file.sh**\n\nlinux系统下以存储从大到小并以K，M，G为单位的方式查看当前目录下的文件信息\n\n**结果展示如下：**\n\n```\nsty@dl-server01:~/styfiles$ sort_file.sh\n2.60G            fastAI\n14.93M           pythonFile\n9.89M            teamviewer_amd64.deb\n24k              styNet\n4k               demo.sh\n\n```\n\n**为什么不用其他的`ls`、`du`呢？**\n这里为你做了一个[详细对比](https://blog.csdn.net/sty945/article/details/79830915)\n\n\n\n# 在linux任意位置都可以使用这个目录下的脚本\n\n我们从Github中下载文件夹到自己的电脑上，解压后，进入文件夹，然后敲命令`pwd`显示当前文件的路径是多少，比如我的电脑的路径是：\n\n```\nsty@dl-server01:~/DIY_Bash$ pwd\n/media/home/sty/DIY_Bash\n```\n\n然后我们打开`~/.bash_profile`\n\n```\nsty@dl-server01:~$ vim ~/.bash_profile\n```\n在`~/.bash_profile`中按照下面的样式加入刚才显示的目录\n\n```\nexport PATH=/media/home/sty/DIY_Bash:$PATH\n```\n然后执行下面的命令\n\n```\nsource ~/.bash_profile\n```\n重新执行刚修改的初始化文件，使之立即生效，而不必注销并重新登录\n\n然后我们就可以在任意的文件夹下使用我们的脚本了\n比如我们只需要在输入`sorf_file.sh`就可以**以从存储大到小的顺序而且人性化的**显示当前文件夹的非隐藏目录的大小了。\n\n## 注意\n如果你出现出现类似下面的错误：`Permission denied`\n\n```\nsty@dl-server01:~$ sort_file.sh\n-bash: /media/home/sty/DIY_Bash/sort_file.sh: Permission denied\n\n```\n这是由于这个脚本没有权限的原因，你只需要进入DIY_Bash文件夹执行下面的命令即可，\n这将为DIY_Bash下的脚本都赋予执行权限：\n\n```\n chmod +x *\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsty945%2Fdiy_bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsty945%2Fdiy_bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsty945%2Fdiy_bash/lists"}