0% found this document useful (0 votes)
44 views

Linux Commands

Linux commands are used to manage servers and data centers. Staff in data centers include hardware engineers, Linux administrators, DBAs, application developers, and testers. Networking is used to connect servers and transfer data between data centers in packets. Common Linux commands are used for system administration tasks like file management, user management, process monitoring, and backups.

Uploaded by

comedy Junction
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Linux Commands

Linux commands are used to manage servers and data centers. Staff in data centers include hardware engineers, Linux administrators, DBAs, application developers, and testers. Networking is used to connect servers and transfer data between data centers in packets. Common Linux commands are used for system administration tasks like file management, user management, process monitoring, and backups.

Uploaded by

comedy Junction
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

LINUX

Its an open source, virus free and secured.


We'll locate our server in secured data centers
data cneter name will depends on airport which is nearer to particular data center
data will be allocated in different types of data cneters which company will be
purchased
data is same in all data centers
when we changes will be happened in one data centre it'll be changed in remaining
all

Staff in Data Centres


1. Data centre
2. Hardware engineer
3. Linux Adminstrators
4. DBA
5. Application Developers
6. Tester (QA)

Need to do test but proper if not we need to do role back it needs more time and
tougher too.
Admin will assign all roles and responsibilities
Networking is used to connect serve and data is connected to packets for transfer.
whenever network has any problem server is down.
it'll be transfered in packets
1 packet= 8kbytes

LINUX COMMANDS

hostname
hostname -i or ifconfig -- ip address
free -m RAM space in MB
free -g RAM space in GB
top Task manager
df -h disk space
ls list of commands
pwd Print working directory
du -sh * size of all directories
du -sh * directory name size of particular directory
chmod change mode
chown
mode numbers are
777 full permissions to everyone
755 full permissions to owner
655 only owner
444 read permission

ls -a list of files including hidden files


cd change directory
cd /etc/ only for administrator to do system installation
mkdir make directory

to create directories in multiples paths

mkdir /uo1/mysql/test/sample1/ /u01/mysql/test1/sample2

rm remove
rmdir remove directory
stat directory name date created
who to know connected users
cal to know calendar
date to know present day date
echo it'll present message on screen

Example:-
d=`date`
echo "$d"
d=`date "+" %F` only date
d=`date "+" %f %h`

man command name to know detailed view of command


touch file.txt to create testfile
vi, vim file.txt to edit the file
wc word count
wc -l no of lines
less file name to read file
less -n file name to read file with line numbers
grep "apple" file.txt
grep -i "aa" file.txt case sensitive disables
mv move files
cp to copy files
cat file.txt to read whole file in desktop
sdiff file.txt file1.sql it'll compare to files
sort file name It'll do sort in alphabetical order
sort -r filename reverse order
sort file1.txt > out.sql for writing in out file
head -2 file name top 2 lines
tail -2 file name bottom 2 lines
cat file.txt file1.sql > merge.sql merging two files
cat >> file2.sql append some data to existing file
which less gives the path of an command
ls -l gives complete information of about all files
chown change owner

Example:chown oracle:oracle file.txt

to change date and time in systems


date --set="23 June 1988 10:00:00"

CRONTAB is an application used for schedule the scripts.


there will be 5 stars
1st star is minutes
2nd star is hours
3rd star day of the month
4th start month of the year
5th star day of the week

crontab -l to see list of crontab


crontab -e to set crontab
to save n exit :wq!
crontab -r to disable all functions
keep # infront of that job to disable that particular job
ex: 15 08 * 01 * /home/root97/skrit/data.sh

ls -lh to know permissions directory


ls -lrth

In vi
:/searinh word
: set nu set numbers for every line
: %s/apple/india/gic replaces apple to india

g-substitution
i-case sensitive
c-confirmation

: %s/a/b/gic replaces a to b
: %s/$/;/g to end all lines with ;
: %s/^/1/g to add a line with 1

shift+g to move cursor end of the document


shift+g+g to move cursor starting of the document
D to del line
insert+delete to del single word

gzip filename to compress the file


gunzip filename to uncompress the file
cd.. for previous directory
tar cvf directory to archive the file
tar ivf directory to un archive the file

tar cvzf directory directory.tar.gz


tae xvzf directory.tar.gz

ssh server name to go to another server


ctrl+D to get back from the server

sed by using we can modify the file without opening it

ex: sed 's/canda/vizag/' job >out1.sql

awk '{print $2 ;}' job >out1.sql prints the second coloumn in every line

shutdown -h now shotdown immediately


shutdown -h +10 after 10 mins
history gives history of commands
history -c to clear history
ps -ef running process will be displayed

sleep 10 sleep for 10 sec


ctrl+z enter b+g to play background
fg -process number play foreground

useradd username to add new user


passwd username to create password for users
ifconfig to know ip address( for some systems it'll not shows)
/sbin/ifconfig/ to know ip address

alias to create our own command


unalias to remove created command
uname -a system information
su -mysql toswitch to another user
ping it'll checks the server or web it's alive or dead
ex: ping google
wget weblink to download any files
ps -ef to know whole process in server
ps -ef/process to know particular process
kill processname to kill the process
>flie.txt to clear complete file without opening it

du -sh * to know the memory

You might also like