Skip to main content

A command line tool to perform custom tasks.

Project description

linux-command

linux-command is a versatile package that provides a collection of frequently used Linux commands in a convenient wrapper. It can be installed via pip and accessed using the cmd command in the terminal.

Installation

To install the package, run the following command:

pip install linux-command

Usage

Once installed, you can access all commands using cmd followed by the specific command name. You can use cmd -h or cmd --help to see the supported commands. Below is a list of supported commands along with examples for each.


1. ls - List files in the current directory

cmd ls

2. ls-all - List all files, including hidden ones

cmd ls-all

3. ls-long - Long format listing

cmd ls-long

4. ls-human - List in human-readable format (file sizes)

cmd ls-human

5. ls-size - Sort files by size

cmd ls-size

6. ls-recursive - Recursively list files in directories and subdirectories

cmd ls-recursive

7. ls-dir - Count the number of directories

cmd ls-dir

8. ls-file - Count the number of files

cmd ls-file

9. ls-reverse - List files and directories in reverse order

cmd ls-reverse

10. ls-time - Sort by modification time (newest first)

cmd ls-time

11. ls-recursive-size - List files and directories recursively with human-readable sizes

cmd ls-recursive-size

12. ls-block-size - Display the size of each file in a specified block size (e.g., K, M, G)

cmd ls-block-size M

13. ps - Show running processes

cmd ps

14. ps-all - Show all processes

cmd ps-all

15. ps-user [username] - Show processes for a specific user

cmd ps-user username

16. ps-aux - Show detailed information about all processes

cmd ps-aux

17. ps-sort-memory - Sort processes by memory usage

cmd ps-sort-memory

18. ps-sort-cpu - Sort processes by CPU usage

cmd ps-sort-cpu

19. ps-grep [keyword] - Search for a specific process by name or keyword

cmd ps-grep python

20. kill [process_name_or_PID] - Kill a process by name or PID

cmd kill process_name

21. df - Show disk usage in human-readable format

cmd df

22. du [path] - Show disk usage for a specific file or directory

cmd du /path/to/directory

23. rm [file_or_directory] - Remove a file or directory with confirmation

cmd rm /path/to/file_or_directory

24. rm [directory] [file_patterns...] - Remove multiple files by pattern (e.g., *.txt)

cmd rm /path/to/directory *.txt *.log

25. grep [pattern] [file] - Search for a pattern in a file

cmd grep "search_term" /path/to/file

26. tar-compress [source directory] [output file] [--exclude file_or_directory ...] - Compress directories into .tar or .tar.gz while excluding specific files or folders

cmd tar-compress /path/to/source /path/to/output.tar.gz --exclude node_modules --exclude .git

This command will compress /path/to/source into /path/to/output.tar.gz and exclude the node_modules and .git directories.

27. tar-extract [source] [destination directory] - Extract a single file or all .tar/.tar.gz files from a specified directory

  • To extract a single .tar or .tar.gz file:
cmd tar-extract /path/to/archive.tar.gz /path/to/destination
  • To extract all .tar and .tar.gz files within a directory (default: all):
cmd tar-extract /path/to/directory /path/to/destination all
  • To extract all .tar files within a directory:
cmd tar-extract /path/to/directory /destination/path tar
  • To extract all .tar.gz files within a directory:
cmd tar-extract /path/to/directory /destination/path gz

28. tar-list [archive] - List contents of a .tar or .tar.gz archive

cmd tar-list archive.tar.gz

29. tar-add [file] [archive] - Add a file to an existing .tar archive


cmd tar-add newfile.txt archive.tar

30. unzip-all [source directory] [target directory] - Extract all .zip files found in a specified directory into a target directory

cmd unzip-all /path/to/zips /path/to/extract

This command will find all .zip files in /path/to/zips and extract each into /path/to/extract.

31. zip-compress [output file.zip] [directory or file ...] - Create a .zip file that includes multiple specified directories or files

cmd zip-compress /path/to/output.zip /path/to/dir1 /path/to/dir2

This command will create a .zip file at /path/to/output.zip that contains everything in /path/to/dir1 and /path/to/dir2.


Contributing

We welcome contributions from the community! If you'd like to help improve linux-command, feel free to report issues or submit pull requests.

Guidelines for Contributors

  • Follow the existing coding style where possible.
  • Make sure your changes do not break existing functionality.
  • Before submitting a major feature, it’s often a good idea to first discuss it by opening an issue.

Thank you!

Thank you for your interest in contributing to linux-command! Your contributions are greatly appreciated and help make this tool better for everyone. For any questions or to get started, feel free to reach out or open an issue.


License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linux-command-0.2.3.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

linux_command-0.2.3-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file linux-command-0.2.3.tar.gz.

File metadata

  • Download URL: linux-command-0.2.3.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.4

File hashes

Hashes for linux-command-0.2.3.tar.gz
Algorithm Hash digest
SHA256 35a724d881b6a0244978d8c8ca5131f3b0ea0fb3d662e24bf0782642dfa4ec53
MD5 d70681e65d7b3da85d502ea781f93d2a
BLAKE2b-256 538e2659beef281fa2960328852a22cb286e08fdf7a74e95dffed3b207d202e5

See more details on using hashes here.

File details

Details for the file linux_command-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for linux_command-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3cb9fc3bb400e78e293a7603d168e629e434727f037047d0cd599c3c39f88cbe
MD5 aa97206f71d1e615e85e67ac22377231
BLAKE2b-256 716860a25ec812d6b455c61bd4e51dcfdc676ef976166a4afd73bf72de46112b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page