Coder Social home page Coder Social logo

terminal-mac-cheatsheet's Introduction

๐Ÿ‘‹ Hi there! My name is Onno, and I'm a freelance Front-end Developer based in Amsterdam. Since I started working in the www in 2005. Since then, I co-founded SaaS startup Tempo, co-founded product development studio Pillar, worked at Sid Lee and freelanced for many years in between.

๐Ÿง‘โ€๐ŸŽจ I'm a maker at heart and enjoy working on the intersection of design and technology. It's my aim to build products that bring real value to people. A pragmatist that also understands the value of the last 5 percent.

๐Ÿงฐ Over the years, I have used a variety of technologies, from Actionscript, PHP to jQuery. Nowadays, my technology stack often includes ReactJS, NextJS, TailwindCSS, etc.

๐Ÿ’Œ Interested in hiring me? Or do you want to collaborate together on a side-project? Happy to chat! Just reach out to me by email.

terminal-mac-cheatsheet's People

Contributors

0nn0 avatar alexwilkerson avatar bashu avatar bear29ers avatar chemfind avatar chemhding avatar codycodeman avatar codyschrank avatar daeungod avatar durul avatar enderahmetyurt avatar gnitoahc avatar hatarist avatar joelibaceta avatar kestory avatar kilianevers avatar larrybattlework avatar matthieu-malyga avatar mrvitaly avatar recepinanc avatar roxhens avatar samarism avatar theotherjonjanes avatar tian3rd avatar toankid1412 avatar vadeg avatar victor-li avatar xugy0926 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

terminal-mac-cheatsheet's Issues

Running an app from Flash Drive

Hi,

I don't know if I'm the right place but here is what I'm trying to do.

Goal: Open an app from any mac using a flash drive.

I'm trying to run an app (QT Wallet app) from my flashdrive, this app requires to have information from it's library folder.

The app itself does not give me the option to re route the library folder thats also on the flashdrive.

Is possible to use terminal? Or perhaps use alias in this case?

Thank you!

Sierra - Why Don't Ctrl A/E Do Anything?

I have some .bashrc & .bash_prfile commands, but none that affect bindings if that's even possible. And my Terminal preferences aren't doing anything crazy. So why won't several of these commands work for me?

Any ideas?

Consider adding $variables

Command Description
[variable]=[value] Set variable equal to value
[command] $[variable] Use variable's value by adding $ before the name

Examples

x=12345
echo $x
timestamp=`date +%Y-%m-%d`
echo $timestamp;
hello=hello;
world=world;
echo $hello $world

Consider adding grep

Consider adding grep

Command Description
grep [search_pattern] [file] Search for all lines that contain the pattern
grep -v [search_pattern] [file] Search for all lines that do not contain the pattern
[string] grep [search_pattern]

Examples

Contents of filename.txt

a/b/c
a/b/c.zip

Search File Contents

# find all lines that contain "a/b/c"
grep "a/b/c" filename.txt

# find all lines that contain "a/b/c" or print if none are found.
grep "a/b/c" filename.txt || printf "\nNo Matches Found.\n"

# find all lines that contain "a/b/c" and do not include ".zip"
grep "a/b/c" filename.txt | grep -v ".zip"

Search Command History

# find all lines in bash history that contain the search_pattern
history | grep search_pattern

Consider adding 'chown [options] [user] [file/folder]'

Consider adding chown

Command Description
chown [options] [user] [file/folder] Change the owner of a file
chown -f -R [user] [folder] Change the owner of a folder and files recursively

Examples

chown -f apache filename.txt
sudo chown -f -R user:group /dir

Consider adding if [ conditional expression ]

Consider adding Conditionals

Examples

if [ conditional expression1 ]
then
    #statement1
    #statement2 
else
    if [ conditional expression2 ]
    then
        #statement3 
    fi
fi
#!/bin/bash
count=99
if [ $count -eq 100 ]
then
  echo "Count is 100"
elif [ $count -gt 100 ]
then
  echo "Count is greater than 100"
else
  echo "Count is less than 100"
fi
# OR example
if [[ "$repl_IO" != "Yes" -o "$repl_SQL" != "Yes" ]] ; then

Wiki - English - Ctrl + D should mention something about EOF

While it is true that Ctrl + D will exit the current shell when no process is running, it is useful to know that you can send EOF to a the running process with Ctrl + D as well.

For example:

  • cat
  • ...waiting for input
  • Ctrl + D and the process exits normally

Consider adding 'chmod +x [file]'

I seem to use chmod quite a bit.

Command Description
chmod [options] mode[,mode] file1 [file2 ...] Change the access permissions to file system objects
chmod +x [file] Allow file to be executed

Example

Allow file to be executed

chmod +x file.sh

File Contents

#!/bin/bash
printf "chmod Rocks! \n\n";

Execute file from the command line

./file.sh

Output

chmod Rocks!

Consider adding apropos

Command Description
Apropos [search-pattern] Searches for command with keywords in description

I think this command is essential for finding new terminal commands. It really opens the user up to new options. It's especially useful with either -h or man [command] to look around for something that can fulfill a specific task

typo

grep -r [search_pattern] [file] Recursively search for all lines that do not contain the pattern

should be

lines that contain the pattern

What does โŒ˜Cmd + L do?

I accidentally typed โŒ˜Cmd + L in my Mac-Terminal and it seemed to delete the output of the previous command. I'm not sure how this shortcut is defined or where I can look it up. Does anybody have an idea?

Option + โ†’ and Option + โ†

It seems that at least since macOS Sierra Option + โ†’ and Option + โ† are equivalent to ESC then F and ESC then B.

Since they are easier to use it may be worth documenting them as well.

Consider adding ;

Command Description
[command] ; [command] Separate multiple commands with ;

Examples

echo run; echo multiple; echo commands; echo from; echo one; echo line
if [ "a" == "a" ] ; then echo "true" ; fi

UPDATES?

Thank you for your work I appreciate been looking for a quick refresher on the key commands. And to all of those whose key commands were having issues. If a CMD'let is not working properly or to your specific requirements then altering the command individually is always an option and updating the profile with the custom cmdlets. Or you could begin to understand the light shinning behind the darkness and begin researching Darwin Series in MAC and why it was discontinued. Then maybe you can understand why things in our lives have stopped be so reliant on our personal control and we now have assistance wether we ask for it or not. ::Only after one opens their mind to the realm of possibilities;; then one can begin to open their mouth and say::: MOO!!!!!!!

Consider adding tar, gzip, bzip2, zip

Command Description
tar -zcvf [.tgz-file] [files] Zip files with gzip compression
tar -jcvf [.tbz2-file] [files] Zip files with bzip2 compression
gzip -f -9 [file] Zip file
tar -zxvf [.tgz-file] Decompress file
tar -jxvf [.tbz2-file] Decompress file

Examples

Compress

timestamp=`date +%Y-%m-%d`
tar -zcvf archive.$timestamp.tar.gz myFolder
tar -zcvf data.tgz *.doc
tar -zcvf pics.tar.gz *.jpg *.png
tar -jcvf data.tbz2 *.doc
ls -l
gzip mydata.doc
gzip *.jpg
ls -l
bzip2 mydata.doc
bzip2 *.jpg
ls -l
zip mydata.zip mydata.doc
zip data.zip *.doc
ls -l

Decompress

tar -zxvf data.tgz 
tar -zxvf pics.tar.gz *.jpg
tar -jxvf data.tbz2
gzip -d mydata.doc.gz
gunzip mydata.doc.gz
bzip2 -d mydata.doc.bz2
gunzip mydata.doc.bz2
unzip file.zip
unzip data.zip resume.doc

Links

Bash Zip CheatSheet

Add how to run commands sequentially or parallel

Hi, this repo is great, serving as a good reference.

Can you add flow control tips?

  • command && command
  • command || command
  • Same things just with one & (what's the difference?)
  • command & (I think it put the result in a background process?)

Thanks

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.