{"id":18082833,"url":"https://github.com/ranfdev/learn_bash","last_synced_at":"2026-01-28T13:02:00.571Z","repository":{"id":104101813,"uuid":"159202909","full_name":"ranfdev/learn_bash","owner":"ranfdev","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-28T21:29:21.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T12:16:15.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ranfdev.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-11-26T16:53:45.000Z","updated_at":"2018-11-28T21:29:22.000Z","dependencies_parsed_at":"2023-04-01T05:36:46.136Z","dependency_job_id":null,"html_url":"https://github.com/ranfdev/learn_bash","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ranfdev/learn_bash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranfdev%2Flearn_bash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranfdev%2Flearn_bash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranfdev%2Flearn_bash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranfdev%2Flearn_bash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ranfdev","download_url":"https://codeload.github.com/ranfdev/learn_bash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ranfdev%2Flearn_bash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28845768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T12:37:07.070Z","status":"ssl_error","status_checked_at":"2026-01-28T12:37:06.657Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-31T14:06:11.115Z","updated_at":"2026-01-28T13:02:00.555Z","avatar_url":"https://github.com/ranfdev.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# learn_bash\nHere i will put some bash tips i have discovered. These are not only related to bash, but to the terminal in general.\n\n## shortcuts\n| shortuct | action |\n| ---------| -------|\n| ctrl+a | start of the line |\n| ctrl+e | end of the line |\n| ctrl+u | cut from cursor to start |\n| ctrl+y | paste what you have just cut |\n| ctrl+r | search in history |\n| ctrl+l | clear screen |\n\n\n## command substitution\nto insert the result of a command as a parameter, put the command between two ticks ``` ` ``` or ```$()```\n```\ntouch `date`\n```\n\n## brace expansion\nBy putting some curly braces near an expression, you can combine the expression with the content of the braces\n```\necho 1{1,2,3} {a,b,c}{a,b}\n```\nreturns\n```\n11 12 13 aa ab ba bb ca cb\n```\n\n## tar\n- To create a tar archive:\n```\n  tar -cf destination from_folder\n```\n- To create a tar archive from stdin:\n```\n  random_program | tar -cf destination --null -T -\n```\nrandom_program should return a file list separated by null characters, to support names with \\n or other escape sequences.\nafter tar, the flag --null enables reading that list of files. The option -T is used to describe where to get the list from. - is the stdin.\n\n## netcat\n- to start listening for tcp connections on a port:\n```\n  nc -l port_number\n```\n- to connect to a remote server which is listening for tcp connections:\n```\n  nc ip port\n```\nAfter establishing a connection between two machines, everything you type in that terminal session,\nis sent to the other device.\n- send file to other device:\n  on the sender device:\n  ```nc -l port \u003c file_path```\n  on the receiver:\n  ```nc ip port \u003e file_path```\n \n - show progress on the receiver\n ```nc ip port | pv \u003e file_path```\n where pv is a utility used to analyze a pipe, it shows the current speed and the bytes transfered.\n \n ## gpg\n - basic file encryption:\n  ```gpg -c file```\n  outputs the file as file.gpg, encrypted.\n - basic file decryption:\n ```gpg -d file \u003e dest```\n \n \n## fzf\nthis is a must have. This program is a fuzzy search utility that can be integrated with various other programs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franfdev%2Flearn_bash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Franfdev%2Flearn_bash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Franfdev%2Flearn_bash/lists"}