Linux Command For DBA

Enable SSH in Linux: –
#chkconfig –list sshd
#chkconfig –levels 2345 sshd on

to find a file in a directory:-
$ find (directory_path) -name (file_name)

to find a value in a vi editor:-
in vi editor [esc] & :/(find_value)

to delete a value in a vi editor:-
in vi editor [esc] & :%s /delete_value

to delete contents in a file:-
in vi editor [esc] & :/%d

to replace a value in a vi editor:-
in vi editor [esc] & :%s /search_value/replace_value

to see the size of a file (or) directory:-
$du -csh (file or directory name)

to count the files & directories in a directory:-
$ls -l |wc -l

to count the files in a directory:-
$find . -type f |wc -l

to count the directries in a directory:-
$find . -type d |wc -l

to see the file-system in linux:-
$file /sbin/init
(or)
$getconf LONG_BIT

How to mount Windows shared folder in Linux: –
$mount.cifs //IPAddrss/share_folder_name/ /mnt -o user=username

Thank you 
Osama Mustafa

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.