Beruflich Dokumente
Kultur Dokumente
Shell Commands
1. Root > user
• Switch to other user account 2. / > Partition
$echo Δ $PATH 3. /root > Folder
$su – Δ username
© Samantha Indika
switch the user
Password database
Switch environment
www.lastpast.com
Password required
© Samantha Indika
$locate Δ –i Δ splash.xpm.gz
$locate Δ –i Δ grub.conf Locate Database
This will get a snapshot of the entire
$locate Δ –i Δ splash hard disk when computer starts and
store in locate database.
Tab1 Tab2
$mkdir Δ ratmalana $su Δ - Δ root
$locate Δ –i Δ ratmalana Password ; 123456
No result #updatedb
$locate Δ –i Δ ratmalana
Output found
© Samantha Indika
Ex: entire root Ex: incase Ex: file’s name or part of the
partition sensitive name file’s name
/ -iname
© Samantha Indika
Ex: grub.conf
#find / -iname grub.conf
Ex: splash
#find Δ /Δ –iname Δ splash
#find Δ /Δ –iname Δ splash*
#find Δ /Δ –iname Δ *splash
#find Δ /Δ –iname Δ *splash*
© Samantha Indika
More MB
than Reference Link
Tingyurl.com/findcmd
TAB1
To locate system objects
To locate sytem configuration files/system commands and their manuals.
Ex: fstab Ex : mkdir
#whereis Δ fstab #whereis Δ mkdir
Only root
To locate system commands
Ex: mkdir
#which Δ mkdir
Prepared by : Samantha Indika | MCT, ACS, CEH, CCNA, BCS
(Certificate), MCS (SL), MCITP, MCTS, MCSE + Security + Messaging,
MCSA + Security + Messaging, MCP 5
Cont... Shell Commands
Command Types
© Samantha Indika
Internal External
in-built to BASH
Ex: cd Ex; mkdir
#type Δ cd #type Δ mkdir
© Samantha Indika
/mnt ;
#mkdir Δ /media/mymount
New system
Any name /media
#ls Δ /media
#ls Δ-l Δ /media/cd*
#ls Δ -l Δ /media/mymount
Mounting
Loading the data structure of a storage device into a mount point
Umount
© Samantha Indika
• Before you takeout or unplug any mounted device be sure to un-mount it properly.
• You can’t be in the mount point.
#umount Δ /media/mymount
Mount point
#eject
#ls Δ –l Δ /media/mymount
© Samantha Indika
Device mount point
#ls Δ –l Δ /dev/fl*
#umount Δ /media/mymount
© Samantha Indika
HDD
PATA SATA
list
© Samantha Indika
The following cannot be mounted
1. Swap partition
2. Extended partition but we can mount logical partitions with in the extended partitions
3. Linux LVM partition but we can mount logical volumes with in the LVM mounts
4. Software RAID partitions but we can mount RAID devices created combing the software
RAID partitions
5. Windows NTFS partitions : but later we can install windows drivers
-Linux (ext3)
-linux LVM
-raid
-HPFS (MS old name)/NTFS (Ms new Name)
-vfat (Extended W95 Extended, if it creates in Windows)
© Samantha Indika
• hpfs/ntfs
#lvdisplay
#mount Δ /dev/VolGroup00/LogVol00 Δ /media/mymount
© Samantha Indika
RAID (Redundant Array of Independent Disks )
RAID is a technology that provides increased storage functions and reliability through
redundancy . This is achieved by combining multiple disk drive components into a logical unit,
where data is distributed across the drives in one of several ways called "RAID levels".
RAID is now used as an umbrella term for computer data storage schemes that can divide and
replicate data among multiple disk drives.
The various designs of RAID systems involve two key goals: increase data reliability and
increase input/output performance.
© Samantha Indika
Prepared by : Samantha Indika | MCT, ACS, CEH, CCNA, BCS
(Certificate), MCS (SL), MCITP, MCTS, MCSE + Security + Messaging,
MCSA + Security + Messaging, MCP 14
Cont... Shell Commands
Standard levels
© Samantha Indika
Prepared by : Samantha Indika | MCT, ACS, CEH, CCNA, BCS
(Certificate), MCS (SL), MCITP, MCTS, MCSE + Security + Messaging,
MCSA + Security + Messaging, MCP 15
Cont... Shell Commands
Verify raid devices
#cat Δ /proc/mdstat
© Samantha Indika
Ex :
Md0
md1
md2
md3
RAID device
#ls Δ /media/mymount
If the hard drive is a portable drive be sure to unmounts the partitions before you unplug the
device.
IF it is a fixed hard drive you can either unmounts Prepared
partitions manually
by : Samantha Indika |or they
MCT, willCCNA,
ACS, CEH, be BCS
automatically uncounted when you shutdown the(Certificate),
system MCS (SL), MCITP, MCTS, MCSE + Security + Messaging,
MCSA + Security + Messaging, MCP 16
Cont... Shell Commands
Object capacity measuring commands
Full device capacity
The device must be mounted before measuring the capacity
© Samantha Indika
$df Δ –hT
$df Δ –hT Δ /
© Samantha Indika
$du Δ –h Δ file path/file name
disk human
usage readable
$du Δ –h Δ /boot/grub/splash.xpm.gz
Folder
Current folder Different folder
$du Δ –hs $du Δ –hs Δ /etc
summery
© Samantha Indika
#uname Δ –s ; kernal name
#uname Δ –n ; node name
#uname Δ –r ; kernal-release
#uname Δ –v ; kernal-version
#uname Δ –m ; i686 > PII or higher
#uname Δ -p ; i686 > Multiple cores
#uname Δ –i ; i386 > 32bit OS
x86_64 > 64bit OS
#uname Δ –o ; Gnu/Linux > OS
© Samantha Indika
RAM information
Full information
#cat Δ /proc/meminfo
Less information
#free
#free Δ -m
MB
PCI Configuration
#lspci
#lspci Δ –v Δ | Δ more
User Types
© Samantha Indika
System Normal
© Samantha Indika
UID (User ID)
0 - 499 = System
60,001 - and up = System
500 - 60,000 = Normal
#id Δ username
#id Δ user1
#id Δ root
© Samantha Indika
New unix password:
If the password is BAD, it will give a warning
Retype the password:
#exit
Or
#logout
Or
Ctrl + D
Prepared by : Samantha Indika | MCT, ACS, CEH, CCNA, BCS
(Certificate), MCS (SL), MCITP, MCTS, MCSE + Security + Messaging,
MCSA + Security + Messaging, MCP 23
Cont... Shell Commands
Multi session login
• Multiple users can be logged in locally at a time.
© Samantha Indika
tty1 Ctrl + Alt + F1
tty2 Ctrl + Alt + F2
tty3 Ctrl + Alt + F3
tty4 Ctrl + Alt + F4
CLI
tty5 Ctrl + Alt + F5
tty6 Ctrl + Alt + F6
:0 Ctrl + Alt + F7 GUI
Pts/1 Terminal in GUI
© Samantha Indika
Current Password:
New Password :
If the Password is BAD
New Password :
If the password is Good
Retype new password :
New Password :
© Samantha Indika
User Name : root
Password : 123456
#chage Δ –l Δ username
#chage Δ –l Δ nimal
List
#chage Δ nimal
© Samantha Indika
#cat Δ /etc/shadow
nimal:$1$ …../ …………….
Encrypted Properties
Password
To lock
#passwd Δ –l Δ username
#passwd Δ –l Δ nimal
Lock
#cat Δ /etc/shadow
nimal:!!$1$ …../ …………….
Locked
© Samantha Indika
Unlock
#cat Δ /etc/shadow
How to reset a user’s password as root
#passwd Δ username
#passwd Δ nimal