3-Linux Basics For A DB Administrator
3-Linux Basics For A DB Administrator
3-Linux Basics For A DB Administrator
2. root as /: the very first directory in Linux is also referred as root directory
3. root home directory: the root user account also has a directory located in /root
which is called root home directory
The second column is the number of hard links to the file. For a
directory, the number of hard links is the number of immediate
subdirectories it has plus its parent directory and itself
• Creating Directories
mkdir
Options:
Modify the way that a command works
Usually consist of a hyphen or dash followed by a single letter
Some commands accept multiple options which can usually be grouped together after a single hyphen
Arguments:
Most commands are used together with one or more arguments
Some commands assume a default argument if none is supplied
Arguments are optional for some commands and required by others
File Permissions
• UNIX is a multi-user system. Every file and directory in your account can be protected from or made
accessible to other users by changing its access permissions. Every user has responsibility for
controlling access to their files.
• whatis command
• command –-help
• man command
Adding Text to Files (Redirects)
The symbol for a pipe is the vertical bar ( | ). The command syntax is:
ls -l | more
File Maintenance Commands
• cp
• rm
• mv
• mkdir
• rmdir or rm -r
• chgrp
• chown
File Display Commands
• cat
• more
• less
• head
• tail
Linux File Editor
• A text editor is a program which enables you to create and manipulate data
(text) in a Linux file
• There are several standard text editors available on most Linux systems
• vi - Visual editor
• ed - Standard line editor
• ex - Extended line editor
• emacs - A full screen editor
• pico - Beginner’s editor
• vim - Advance version of vi
Files
• /etc/passwd
• /etc/group
• /etc/shadow
Example:
useradd –g superheros –s /bin/bash –c “user description” –m –d
/home/spiderman spiderman
Switch Users and sudo Access
Commands
• su – username
• sudo command
• visudo
File
• /etc/sudoers
“ps” command
• ps command stands for process status and it displays all the currently running processes in the
Linux system
Usage examples:
• ps = Shows the processes of the current shell
• Usage: top
Please note:
Top command refreshes the information every 3 seconds
Usage:
o crontab –e = Edit the crontab
o crontab –l = List the crontab entries
o crontab –r = Remove the crontab
o crond = crontab daemon/service that manages scheduling
o systemctl status crond = To manage the crond service
• Network Commands
• ping
• ifconfig
• ifup or ifdown
• netstat
• tcpdump
Client = A Server = B
ssh
scp
sshd = 22