Giter VIP home page Giter VIP logo

linux's Introduction

Linux常用命令

展示方式说明

所有的展示都是通过以下三个部分组成:
1、问题
2、代码or解决方案
3、参考资料

Q1: linux通过zip命令压缩指定格式文件?
Code:

# 如果dir_name目录下有四种格式的文件: .csv, .xlsx, .ipynb以及.py文件,
# 我们只想压缩.ipynb和.py文件,有两种方式

# 1.显示的指出要压缩的文件格式
zip -r dir_name.zip dir_name --include '*.py' '*.ipynb'

# 2.显示的指出要剔除的文件格式
zip -r dir_name.zip dir_name --exclude '*.csv' '*.xlsx'

# 剔除隐藏文件的
zip -r dir_name.zip dir_name --exclude '*/.*'

References:
https://superuser.com/questions/831169/from-the-command-line-how-do-i-zip-specific-files-and-directories-into-one-comp

Q2: linux通过find命令删除指定格式文件?
Code:

# 删除当前目录及子目录下的.csv文件
find . -name '*.csv' -delete

References:
https://stackoverflow.com/questions/785519/how-do-i-remove-all-pyc-files-from-a-project

TO BE CONTINUE

License

MIT

linux's People

Watchers

wuboyu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.