Terminal Commands - Beginner should learn the basic of shell script with linux command line on macOS | Apple iOS Xcode YouTube Seminar #24


GNU bash, version 3.2.57(1)-release


- learn basic of bash shell scripts for beginners
- introduction of linux commands for iOS app handling
- create some shortcut command with macOS


Shell scripts that Beginner should study are linux commands from shell command prompt


* Here is the highlight of YouTube tutorial.

In this tutorial, let me introduce bash shell scripts that I often used for development of iOS app. Most of them are for beginners. So, don't worry if you have not experienced linux commands yet.

For future, these commands will be useful for control of web server, automatic icon reation or importing library.

The basic is the most important for everything so let me show you the demonstration by showing them as follows;


create file
create folder
open app
open file
delete file
delete folder
copy file



You may feel like using mouse for these easy commands but combination of other commands will make it for your future.

First, try to let your command prompt say "Hello World" with the following commands.


echo
print
ctr + P
ctr + N
;



You can connect two commands wit the letter ";". With Ctr + "P" or "N", you can use your last command from history. They are also useful.

Compared with GUI, CUI needs to know in which directory you are now. Please use the following commands to confirm your current directory and move it.


touch
mkdir
cd
ls
ls -l
ls -a
../
pwd



Please see how it works on my YouTube video so that you can deeply learn how important it is. For file manager, you can use the following commands. They include the most terrifying command, "rm -rf". It may cause a crash of system if you accidentally use it at root directory. So, please be careful especially for using rm command.

vi q w
cat
cp
rm
rmdir
rm -r
rm -rf

Finally, let me show you how to open or close your favorite app with shell scripts.


open
killall

open -a "/Applications/Safari.app"; open -a /Applications/Xcode.app;

killall OneDrive; killall Box; killall Backup\ and\ Sync;



The code, "open" will start apps instantly. On the other hand, you can use "kill" command to close them.

Copy and paste these command lines for easy use. In my case, I record these kinds of commands in mac app stickies.


To get the source code, check the comment of my YouTube

Back to Table List

2020年02月21日