Code Monkey home page Code Monkey logo

terminal-utils's Introduction

terminal-utils

How to find something inside files

Search all files in current directory

grep string *

Search all files in current directory with given pattern

grep string *.txt

Matching line and 1 after

grep -A 1 "string" *.txt

Matching files

grep -l string *

Multiple strings

grep '208302030\|208302031\|208302032\|208302033\|208302034\|208302035\|208302036\|208302037\|208302038' *.csv


Order files by date (old -> new)

ls -tr | xargs grep string

How to transfer files over SSH

scp /home/myuser/folder/file.ext [email protected]:/myserver/tmp/name_for_file.ext

How to append the output of a command to the end of a file

command &>> output.txt

How to copy a folder from a docker container

docker cp container_name:/path/to/container/folder /path/to/external/dir

How to use mysqldump inside docker container

docker exec -it container_name mysqldump -u root --password=123456 schema_name --fields-terminated-by ',' /
--fields-enclosed-by '"' --fields-escaped-by '\' /
--no-create-info --tab /var/lib/mysq-files/

How to copy multiple times the content from one file to another

for i in {1..25}; do cat 02122020_log.csv >> 02122020_log_huge.csv; done

How to copy a file multiple times with fixed names

for name in "accounts.factory.ts" "cards.factory.ts" "coach-contracts.factory.ts" "coaches.factory.ts" "formations.factory.ts" "games.factory.ts" "goals.factory.ts" "injuries.factory.ts" "lineups.factory.ts" "player-contracts.factory.ts" "players.factory.ts" "referees.factory.ts" "saves.factory.ts" "stadiums.factory.ts" "statements.factory.ts" "teams.factory.ts" "tournaments.factory.ts" "users.factory.ts"; do cp "season.factory.ts" "${name}"; done

Stop asking for passphrase for given key

ssh-add /Users/my_user/.ssh/id_ed25519

How to stop a process by port number

kill -9 $(lsof -t -i tcp:8080)

terminal-utils's People

Contributors

lucasbagatini avatar

Watchers

 avatar  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.