-
List all files modified in a commit:
git diff-tree --no-commit-id --name-only -r <COMMIT_HASH> -
Setup git credentials locally.
To setup your git credentials locally and to avoid having to provide your username and password everytime you pull and push, run
git config credential.helper storethen do a git pull and provide your username and password
-
Get specific line numbers from a file:
sed -n '207,208p;370,400p' <FILENAME>This will return lines
207,208and lines369through400 -
Split a comma delimited file and find the unique counts for each value in a given column If
input.csvisfruit, qty apple, 1 banana, 2 carrot, 3 apple, 4and we want to find the count of fruits, then run
cat input.csv | awk '{split($0, a, ","); print a[1]}' | sort | uniq -cThe output will be,
2 apple 1 banana 1 carrot 1 fruit -
awkwith anifcondition Ifinput.csvisfruit, qty apple, 1 banana, 2 carrot, 3 apple, 4and we want to find out which of these fruits have a count more than 1, then
cat input.csv | awk '{split($0, a, ","); print a[1]}' | sort | uniq -c | awk '{ if ($1 > 1) print $2":"$1}'The output will be,
apple:2 -
Loop through files in a directory to search for a keyword
find . -iname "*" -type f | xargs grep "<KEYWORD>"Alternatively you can use the_silver_searcher.
-
Notifications
You must be signed in to change notification settings - Fork 0
Akilesh1989/command-line-stuff
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
About
A list of commands I have found to be useful
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published