Articles in the Linux Tutorials Category
Command yum
Yum :
Yum is an interactive ,rpm based,pakackage manager.It can automatically performs system updates.It also performs installation of new packages and removal of new packages.
Below are the yum manual
To list the yum options
$yum -h
To list the installed package that matches given string
$yum list httpd
To localate all packages that contain the string …
File Systems and Partitions using FDISK
fdisk (for “fixed disk”) is a commonly used name for a command-line utility that provides disk partitioning functions in an operations.
To check the connected storage on the linux partition ,type below command.
$fdisk -l
(it displays connected storage table details)
To create partition ,you need to run below commands
$fdisk /dev/sda2
arugments
n’ – to …
strip directory and suffix from filenames using basename
basename – strip directory and suffix from filenames.
Print NAME with any leading directory components removed. If speci? fied, also remove a trailing SUFFIX.
Example:
smartproteam@smartproteam:~$ basename /usr/local/
local
another example
smartproteam@smartproteam:~$ basename /var/log/messages
messages
simple Bash calculator on command line interface
Bash is a shell Command-Line Interface that is very popular in Unix/ Linux. Like a shell on Unix, Bash is not a simple shell. It has lots of features.
One of the features of Bash can be used as a simple calculator. If you are in command-line mode, you do not …
few usefull text processing using “awk” with examples
1.print the latest file from a directory
admin@smartproteam~$ls -ltr *.* | awk ‘{ f=$NF }; END{ print f }’
example2.txt
2.Adding double space to a file
admin@smartproteam~$cat example2.txt | awk ‘NF{print $0 “\n”}’
whazzz you
12
223
1
12
433
4433
3.Print total number of line in a file
admin@smartproteam~$cat example2.txt | awk ‘END{print NR}’
7
4.print line number 4 from a file
admin@smartproteam~$cat example1.txt | …
linux command “paste” with example
paste : Using paste you can merge lines of files.
example :
think that you have two text files example1.txt and example2.txt
in example1.txt which contents
admin@smartproteam~$cat example1.txt
the man
wat man
you the man
man the man
man says to ma:wq
in example2 test file
admin@msartproteam~$cat example2.txt
whazzz you
12
223
1
12
433
4433
now you will run paste command
admin@smartproteam~$paste example1.txt example2.txt
the man whazzz …
Generate a hardware report in html format using lshw on linux
If you want to generate a hardware report of your workstation,desktop and laptop it very useful command.
lshw means list hardware on linux.
Example :
admin@smartproteam~$sudo lshw -html > myhardwarelist.html
(note : you need to be root to run this command )
myhardwarelist.html on the pwd(present working directory) with list of your hardware and configuraion …
spliting a large file into small chunks on linux
Using “split” command you chunk large files into smaller chunks.
For you if you have 500mb of file you chunk into 100mb file each
Split : split a file into pieces
admin@smartproteam~$ split 100mb mydocs-files.zip
it wil create 5 files each one of the size 100mb
xa
xb
xc
xd
xe
if you want to join all the …
Mysql tips
Show variables :
SHOW VARIABLES shows the values of MySQL system variables. This information also can be obtained using the mysqladmin variables command.
to check the mysql variables :
mysql > show variables;
Variable_name | Value |
+———————————+—————————–+
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
| automatic_sp_privileges | ON |
| back_log | 50 |
| basedir …
Linux PS command sort by memory use
Do you want to the ps command sort with memory use.below is the command
smartproteam@smartpro:~$ ps aux –sort:rss
output :
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
mysql 5712 0.0 1.6 127768 17256 ? Sl Sep13 0:17 /usr/sbin/mysql
90171 13744 0.3 1.7 30228 17636 ? S 19:51 0:05 gedit
90171 22557 0.0 …


