Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Linux

No description
by

Brian Layton

on 6 March 2015

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Linux

Linux

for the
technical support engineer
Part 1 - Intro
What is Linux
Who is Linux
It's GNU
(not Unix)
Yes that is the only reason
I wanted this snowboard
What does Linux taste like
The world of embedded Linux
The Three Forks
Many flavors existed in the beginning, the following are the three main forks that still exist today.
Slackware
- July 16, 1993 v1.0
-- SuSE / openSuSE / SUN JDS / Slackintosh
Debian
- July 16, 1993 v0.01
-- Ubuntu / Mint / Knoppix / LEAF / Gibraltar
Redhat
- Oct 31 1994 v0.9
-- Fedora / CentOs
More Flavors
Puppy
(from main branch)

Arch
(main branch)

Gentoo
(orphan)
BusyBox
is really not that busy
Originally developed as a rescue disk for Debian
Ran on a single floppy disk
All commands are linked to one executable
No longer required large overhead
(cygwin) - runs linux in windows
Part 2:Tools of the trade
Part 1: Intro
Navigation
Finding your way
Opening Files
Editing files
Rules of the road
Access
File System
Finding your way...
Knowing how to search for file names or txt within a file is a must for efficiency.
Most common commands: find, grep



Once you find what you are looking for we have more tools to extract and filter the output.
Most common commands: find, grep, egrep, fgrep, cut, awk, head, tail, more, less, cat, pipes, redirects, regular expressions, ls, recursive commands, scripts
pwd
(print working directory)
+
UGO 765 421

4 stands for "read",
2 stands for "write",
1 stands for "execute", and
0 stands for "no permission."
cd
(change directory)
hostname (list the hostname)
ifconfig -a (list network interfaces)
uname -a (show the linux kernel version)
cat /etc/issue (display os flavor)
ls
(list files)
whoami or who am i (show user logged in as)
netstat -r (display routing information)
Navigation
Rules of the road
(permissions)

chmod
(change mode)
chown
(change ownership)
ls -l
(list files and permissions)
chmod u=rxw,g=rx,o=r filename
chmod 754 filename
-rwxr-xr-- filename
Finding your way
find
grep
| pipe
cat
more
less
ps
vi
Opening Files
cat:
print out file
more:
print out file use spacebar to goto next page
less:
"less is more" more powerful
vi:
used for editing and viewing files
Resources
Editing Files
Creating
Modifying
Removing
vi
cat
redirect
echo
cp
vi
cat
redirect
echo
cp


rm (remove)
the most famous one liner
"rm -rf *"
(should be) "rm -rf ./*"
Archive (buns & guns)
Access
Archiving (buns & guns)
Resources
http://www.fromdev.com/2013/06/linux-basic-commands.html
Tools of the trade
(Linux Apache MySQL php)
Part 3: LAMP
http://www.techrepublic.com/blog/10-things/the-10-most-useful-linux-commands/
http://www.thegeekstuff.com/2010/11/50-linux-commands/
http://www.computerhope.com/unix/uchmod.htm
http://www.cyberciti.biz/faq/understanding-bash-fork-bomb/
http://www.thegeekstuff.com/2012/02/dig-command-examples/


/home
Home directories of the common users.

/tmp
Temporary space for use by the system, cleaned upon reboot, so don't use this for saving any work!

/bin
Common programs, shared by the system, the system administrator and the users.

/sbin
Programs for use by the system and the system administrator.

/usr
Programs, libraries, documentation etc. for all user-related programs.

/var
Storage for all variable files and temporary files created by users, such as log files, the mail queue,
the print spooler area, space for temporary storage of files downloaded from the Internet, or to keep an image
of a CD before burning it.

/proc
A virtual file system containing information about system resources. More information about the meaning
of the files in proc is obtained by entering the command man proc in a terminal window. The file proc.txt discusses
the virtual file system in detail.

/etc
Most important system configuration files are in /etc, this directory contains data similar to those in the Control Panel in Windows

/root
The administrative user's home directory. Mind the difference between /, the root directory and /root, the home directory of the root user.






blayton@tuxpad2:~$
ls -lrt

-rw-rw-r-- 1 blayton blayton 18 Feb 27 14:51 donkey *** permissions are currently 664
blayton@tuxpad2:~$
chmod
u=rwx,g=rx,o=r donkey (or
chmod 754
)
blayton@tuxpad2:~$ ls -lrt
-rwxr-xr--
1 blayton blayton 18 Feb 27 14:51 donkey
blayton@tuxpad2:~$
ls -lrt
animal/
total 12
-rwxrw---x 1
blayton admin
18 Feb 27 14:51 donkey
-rw-rw-r-- 1
blayton blayton
6 Feb 27 14:57 weirdo
-rw-rw-r-- 1
blayton blayton
4 Feb 27 14:58 tiger
blayton@tuxpad2:~$

root@tuxpad2:/home/blayton#
chown -R blayton:mysql
animal/
root@tuxpad2:/home/blayton#
ls -lrt
animal/
total 12
-rwxrw---x 1
blayton mysql
18 Feb 27 14:51 donkey
-rw-rw-r-- 1
blayton mysql
6 Feb 27 14:57 weirdo
-rw-rw-r-- 1
blayton mysql
4 Feb 27 14:58 tiger
R = recursive (change ownership of
all files in the directory animal)
4 stands for "read",
2 stands for "write",
1 stands for "execute", and
0 stands for "no permission
.
man
(RTFM)
fork Bomb

:(){ :|:& };:
This is called a fork bomb.

:() means you are defining a function called :

{:|: &} means run the function : and send its output to the : function again and run that in the background.

The ; is a command separator, like &&.

: runs the function the first time.

Essentially you are creating a function that calls itself twice every call and doesn't have any way to terminate itself. It will keep doubling up until you run out of system resources
blayton@tuxpad2:/usr/local/Pro-Vision$
find /usr/local/Pro-Vision -name hb* -print
/usr/local/Pro-Vision/logs/hbn.txt.1
/usr/local/Pro-Vision/logs/hbn.txt
/usr/local/Pro-Vision/classes/hbnlib
/usr/local/Pro-Vision/conf/backup/BaseVersion/classes/hbnlib
blayton@tuxpad2:/usr/local/Pro-Vision$
find example(s)
[root@pv301-225 tmp]#
find / -iname provision -print
/usr/local/ProVision302/classes/hbnlib/com/mrv/provision
/usr/local/ProVision302/apache/tomcat/webapps/Pv3/WEB-INF/classes/com/mrv/provision
/usr/local/ProVision302/apache/tomcat/webapps/wp/WEB-INF/classes/com/mrv/provision
[root@pv301-225 tmp]#
root@tuxpad2:/usr/local/Pro-Vision#
find / -name *.log -print
blayton@tuxpad2:/usr/local/Pro-Vision$
find / -name *.log -print
find: `/root': Permission denied
find: `/etc/ppp/peers': Permission denied
find: `/etc/freeradius': Permission denied
grep example(s)
R7-OS906C-175#
show syslog |tail -10 |grep -i enable
Feb 27 15:01:46 R7-OS906C-175 ZebOS[16469]: INFO, executing command 'enable' in
ENABLE_NODE

R7-OS906C-175#
show syslog |wc -l
2047677
R7-OS906C-175#
show syslog |grep "Feb 16 11:4"
Feb 16 11:44:57 R7-OS906C-175 aaa[13208]: INFO, aaa_pam.c(313), - User <admin> was successfully aut
Feb 16 11:45:02 R7-OS906C-175 ZebOS[13209]: INFO, vtysh instance started
Feb 16 11:45:03 R7-OS906C-175 ZebOS[13209]: INFO, executing command 'enable' in ENABLE_NODE
Feb 16 11:45:12 R7-OS906C-175 ZebOS[13209]: INFO, executing command 'configure' in ENABLE_NODE
Feb 16 11:46:59 R7-OS906C-175 sudo : TTY=pts/1 ; PWD=/home/admin ; USER=root ; COMMAND=/usr/lo
Feb 16 11:47:00 R7-OS906C-175 ZebOS[13209]: INFO, executing command 'password' in CONFIG_NODE
Feb 16 11:47:00 R7-OS906C-175 ZebOS[13209]: WARNING, Warning: terminal is not piped into 'more' !
Feb 16 11:47:03 R7-OS906C-175 UiD[597]: INFO, uid_evn.c(137), - /usr/local/nbase/bin/vtysh unregisters all
Feb 16 11:47:03 R7-OS906C-175 last message repeated 2 times
R7-OS906C-175#
R7-OS906C-175#
show lt |grep 2200
72 00:00:02:00:03:00 2200 2 DYNAMIC 02/26/2015 15:00:57
73 01:80:C2:00:00:32 2200 Intern STATIC 02/26/2015 15:00:06
74 01:80:C2:00:00:3A 2200 Intern STATIC 02/26/2015 15:00:06
75 3C:A7:2B:00:5E:3B 2200 Intern STATIC 01/21/2015 13:37:00
76 3C:A7:2B:04:67:61 2200 2 DYNAMIC 02/26/2015 15:00:56
77 3C:A7:2B:04:6B:9B 2200 5 DYNAMIC 02/26/2015 15:00:57
78 3C:A7:2B:DF:5E:3B 2200 Intern STATIC 02/26/2015 15:00:06
R7-OS906C-175#
R7-OS906C-175#
show memory |grep -i free
MemFree: 108628 kB
SwapFree: 0 kB
R7-OS906C-175#
R7-OS906C-175#
show version |grep -i Master
MasterOS version: 2_2_2A
R7-OS906C-175#
tail:
(show last lines of file)
head:
head -10 (show first 10 lines of file)
man
grep example(s)
console
telnet
(terminal network)
ssh
(secure shell)
xwindows




tar
gzip
bzip
compress
zip
http://www.tecmint.com/18-tar-command-examples-in-linux/
Archiving (buns & guns)
tar (tape archive)
: used to archive files or entire directories
tar -cvf : create file
tar -tvf: look inside tarball without extracting it
tar -xvf: extract tarball
[root@pv301-225 log]#
tar -cvf /tmp/logmessage.tar messages*
messages
messages-20150215
messages-20150222
messages-20150301
[root@pv301-225 log]#

[root@pv301-225 log]# ls -lrt /tmp
total 28
drwxr-xr-x. 4 root root 4096 Aug 17 2013 vmware-tools-distrib
drwxr-xr-x. 2 root root 4096 Feb 13 16:29 hsperfdata_root
-rw-r--r--. 1 root root 20480 Mar 2 16:00
logmessage.tar
[root@pv301-225 log]#
create tar file in the tmp directory
called logmessages.tar
containing all messages* files in /var/log


Archiving (buns & guns)
[root@pv301-225 tmp]#
gzip -9 logmessage.tar

[root@pv301-225 tmp]# ls -l
-rw-r--r--. 1 root root 1346 Mar 2 16:00 logmessage.tar.
gz
[root@pv301-225 tmp]#



[root@pv301-225 tmp]#
bzip2 logmessage.tar
[root@pv301-225 tmp]# ls -lrt
-rw-r--r--. 1 root root 1455 Mar 2 16:00 logmessage.tar.
bz2


[root@pv301-225 tmp]#
bunzip2 logmessage.tar.bz2
[root@pv301-225 tmp]#
gunzip logmessage.tar.gz
compress / uncompress (.Z) extension
Mount
samba
nfs
fuse
File Transfer
ftp
tftp
sftp
scp
rcp
Editing Files
blayton@tuxpad2:~/tech$
echo "hello brian" > tech
blayton@tuxpad2:~/tech$ cat tech
hello brian

blayton@tuxpad2:~/tech$
echo "hello layton" >> tech
blayton@tuxpad2:~/tech$ cat tech
hello brian
hello layton
blayton@tuxpad2:~/tech$
cat tech |grep -i brian > tech4
blayton@tuxpad2:~/tech$ cat tech4
hello brian
> = overwrite
>> = append
blayton@tuxpad2:~/tech$
vi tech5
cat file tech
look for lines with "brian"
store in file tech4
df -h (display file system size)
Access
blayton@tuxpad2:~/tech$
ssh blayton@127.0.0.1
The authenticity of host '127.0.0.1 (127.0.0.1)' can't be established.
ECDSA key fingerprint is 17:dc:4f:0a:d4:2b:ab:48:51:78:a4:0a:01:63:ad:e6.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '127.0.0.1' (ECDSA) to the list of known hosts.
blayton@127.0.0.1's password:
Welcome to Ubuntu 14.04.2 LTS (GNU/Linux 3.13.0-46-generic x86_64)


blayton@UbuntuServer:~$
scp syslog.txt blayton@192.168.54.146:
blayton@192.168.54.146's password:
syslog.txt 100% 30KB 30.0KB/s 00:00
blayton@UbuntuServer:~$



blayton@UbuntuServer:/tmp$
scp blayton@192.168.54.146:newsyslog.txt .
blayton@192.168.54.146's password:
newsyslog.txt 100% 30KB 30.0KB/s 00:00
blayton@UbuntuServer:/tmp$


blayton@UbuntuServer:/tmp$
sftp blayton@192.168.54.145
blayton@192.168.54.145's password:
Connected to 192.168.54.145.
sftp>
mount -t cifs -o credentials=/home/blayton/b.txt //192.168.51.26/group /mnt/samba
scp get
scp put
network share
Installing LAMP on CentOS
What can LAMP do for Pro-Vision
Q: So what can you do with it?
mysql> select DBVERSION from ServerOptions;
+-----------+
| DBVERSION |
+-----------+
| 3.0.2 |
+-----------+
1 row in set (0.00 sec)

mysql>
As technical support penguins we can use phpmyadmin to quickly find what tables / columns we want to query for a customer issue.
how to log into mysql
from a remote system
select your database
display tables
There can be a lot of tables in customer database
mysql> select DBVERSION from ServerOptions;
recursive acronym for “GNU's Not Unix”
there's an app for that...
Part 4:
Mt Washington
http://wiki.centos.org/HowTos/Network/IPTables

https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-a-centos-6-4-vps
sftp
ssh
http://www.albany.edu/faculty/hy973732/ist535/vi_editor_commands.pdf
http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html
Rules of the road (permissions)

clear
(clear screen)
Full transcript