Professional Documents
Culture Documents
Linux Portion
Linux Portion
Linux Portion
Understanding partitions
/etc/inittab – to check the default runlevel which is the current for server
chkconfig -
cp – copy file/ directory(-b, -f, -i, -r, -R, -s, -u, -v). By default cp overwrites the
existing file without prompt(-f option); -I will prompt before overwrite
ls – listing the directory contents(-aA, -c, -C, -w, -d, -f, -F, -gG, -h, -i, -kl, -o, -r, -R,
-s, -S, -t, -U, -u, -1)
lsof – This command shows you files opened by process which are running. lsof
is an increadibly powerful command-line utility for unix systems. It lists open
files, displaying information about them. And since most everything is a file on
unix systems, lsof can give sysadmins a ton of useful diagnostic data.
more & less - (less is advance of more in which scroll upward is also allowed)
head /tail – displays start/end of the file. Mainly tail is used to see end of a
logfile(-n, -f with tail, -v, -q, --pid with tail)
touch – change modify/access time of a file if file does not exists. It creates the
file(-a,-c,-d,-m,-t)
du – displays disk usage. It gives summary of disk usages of each and every
files/ directory (-h, -k, -m, -S, -X). #du - This command will show the usages of
disk by files and folder. Output of this command show in bytes.
To know that how much space is consumed by any specific file. For example
#df /
chkconfig
which – gives path of the command(user created/ system commands) i.e
where the command comes from for example if you give which
#which ln
uname – gives you the system information like OS, kernel version, os bit,
processor type etc ( -s kernel name, -r kernel release, -v kernel version, -m
hardware name, -p processor type, -i hardware platform, -o operating system)
(Note: bit information about the os bit is also find by command getconf for e.g.
getconf LONG_BIT – it will straight away displays 32 bit of os or 64 bit
of os. Apart from bit info we can even get the page size info if we
write getconf PAGE_SIZE, it will display page size on rhel system. Try
to understand all the options used with getconf)
useradd – adding a user (-c, -b, -d, -m, -g, -G, -K, -r, -u, -o)
users – who is currently logged in. You can specify input file also
who am i
w – who is logged in and what they are doing. Understand the output of it
last – gives history of logins & reboot of systems (when last time the server had
reboot)
uptime
finger – gives user info like Login name, real name, terminal name, home
directory
env
Profile of a user
/etc/profile
/home/username/.bash_profile
/home/username/.bashrc
Opening and editing multiple files with options to open, edit, save a file. Also
cursor movement options
Communication Command : mail, mesg, write
find command is used to find any object in linux. For searching object you can
also use locate command but locate command is based on mlocate database. For
example to find vinita directory on entire linux use
tar – Need of tar. (Using –c,-v,-f, -t, -x options with tar) Zipping using tar.
Extract single file from tar
ln – soft link v/s hard link. Creating soft link & hard link. What if original file is
deleted
Understanding diff between soft link and hard link. What is symbolic link?
wc – count no. of character, words, lines etc
grep (egrep, fgrep)– search a pattern in a file- grep is a command-line utility for
searching plain-text data sets for lines matching a regular expression. Grep was
originally developed for the Unix operating system, but is available today for all
Unix-like systems. Its name comes from the ed command g/re/p (global / regular
expression / print)
cut
awk – fetch/ display column from a file (awk command combines the functions of grep
and sed) - AWK was created at Bell Labs in the 1970s, and its name is derived from the
family names of its authors – Alfred Aho, Peter Weinberger, and Brian Kernighan. The
name is not commonly pronounced as a string of separate letters but rather to sound the
same as the name of the bird, auk (which acts as an emblem of the language such as on The
AWK Programming Language book cover - the book is often referred to by the abbreviation
TAPL). awk, when written in all lowercase letters, refers to the Unix or Plan 9 program that
runs other programs written in the AWK programming language.
sed-
gawk
STDIO: redirect i/o, redirect errors, using pipes, & >, >>, <, <<, 2>, 2>>, | (output of
first is given to next command
Day 8: Processes
Day 9: Networking
On Linux machines, the following file consists all the list of port assignments for
the specific machine:
/etc/services
ifconfig – display Ethernet info, IP, subnet mask, interface up/down and other
statistics. Also use to change system IP.
rpm – package manager used to install, upgrade, uninstall packages (-I, -v, -h,
U, e, q)
cron – Job scheduler. -
sar – system analysis report ( RPM required to be installed for sar is - sysstat)
Profiles
cat /proc/cpuinfo
Extra :
put hard and soft limit on file size for a particular user – use of fsize in /etc/limits.conf –
nfs sever – share the mount point and mount it on local machine
create ftp server - commands at ftp prompt and ftp to be accessed by web browser
ftp command and using ftp for internet browser to connect to client –
ftp>
ftp://user:password@ip address
Samba server