This tutorial follows up on … Linux Bash Mac Terminal Tutorial. We delve more into the wonderful world of Linux and the command line with an approach of “doing some things”. With command line work it is easier to learn this way. Within reason, there is nothing stopping you trying things, and that way, as long as you are careful, and use “help” and “man” a lot before doing something, you can learn a lot about the underlying operating system of your computer. In our case this is a Mac laptop and using the Mac application Terminal to delve into this very interesting and huge field of study. You could do things for days with all the possibilities, and really would like to think you get in there and try ideas out for yourself. One of the little slides below, for instance is called the “three P’s” and shows you “Hello World” from the Linux Bash command line for PHP, Perl and Python … so when I said “days” what I should have said was “years”! As always there are good sources of information on the web.
Let’s look at some command line Linux Bash commands:
- pwd … find … cd … ls … cat
- cat | cut/awk
- cat | sed/tr
- cat … head … tail | grep/wc
- df -k … ps -ef
- who am i
- help
- cat … tail | awk
- The Three “P’s”
- whereis
- … cut | sort
- stat
- find … -exec – Find a file and act (with actions) on each file
Did you know?
-
In a Mac Linux Bash Terminal session command-T is a quick way to open a new shell.
-
If you are in the middle of a program like “mail” when you go control-T you get a snapshot like “load: 1.35 cmd: mail 21804 waiting 0.00u 0.00s”
Previous tutorial below … Linux Bash Mac Terminal Tutorial …
Tutorial …
Transcript:
Do you own a Mac laptop or desktop?
Have you heard of the application Terminal?
It is like Command Prompt in Windows and if you know Bash scripting it can open a
whole new world of possibilities with your Mac. The operating system is Linux.
If you are a beginner you need to start slowly, and in this tutorial we will only do
benign commands that read rather than write.
We’ll do a bit of:
pwd
echo
cd
ls
cat
more
ps
df
In your search engine look for “Linux commands” for further information. Once you see
a command of interest, at Linux (with Bash) you can type:
man [command]
… to find further information.
So here goes … we will open the Terminal application … then run a preprepared
Bash script … but just concentrate on its commands, rather than doing scripting
… that is for later … at the end of the presentation the Bash script is typed
out for you.
Let’s explore some more Linux Bash shell commands below on 20/3/2013 …
If this was interesting you may be interested in this too.
If this was interesting you may be interested in this too.