#This python script is to get system’s VGA monitor info import commands command = “lspci | grep VGA ” status, vgaInfo = commands.getstatusoutput(command) print “VGA info=%s” % ( vgaInfo ) which will give the output VGA info=00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18) in my system
Category Archives: Commands
[Ubuntu][Fedora][Linux]Error – mysql_config: not found
Installing libmysqlclient-dev will solve the error sudo apt-get install libmysqlclient-dev If it still gives error , install python-dev sudo apt-get install python-dev In Fedora, use yum install instead of apt-get install
How to find file system details of a hard disk in Linux
mount command will give the information of the file system details of mountable devices
[Shell Script]How to execute multiple shell commands using a single shell variable ?
To execute multiple shell commands using a single shell variable,Assign the multiple shell commands to a variable.execute the shell variable using echo eg:Find a.txt in the present directory Let the multiple commands are ls and grep Let the shell variable is cmd .cmd=$(ls | grep a.txt )To execute the commands ,echo $cmd cmd=$(ls | grep test.txt)
[Linux][Commands]How to find files by its size in a directory
find dir_name -size 50M –> This command is for finding files with size 50MB find dir_name -size -50M –> This command is for finding files with size smaller than 50MB find dir_name -size +50M –> This command is for finding files with size bigger than 50MB where the dir_name is theContinueContinue reading “[Linux][Commands]How to find files by its size in a directory”
[Linux]How to display last few lines of a file without opening the file
Using “tail” command , we can display last few lines of a file without opening the file eg:tail -5 filename
[Linux]How to display first few lines of a file without opening the file
Using “head” we can display n number of lines in a file without opening it head -8 filename
[Linux]How to create parent directories as needed with one command
mkdir -p dir1/dir2/dir3 This command will create a sub directory ,dir3 , inside dir2, which is the sub directory of parent directory, dir1
[Linux]how to copy all the files of same format from a directory which is having multiple direcotries inside, to another location
how to copy all the files of same format from a directory ,which is having multiple directories inside, to another location cp `find -name *.txt` Loc_to_copy where Loc_to_copy is the location to copy .
[Linux]Info about halt command
halt command in the system alias to run level 0 when you run halt command , actually “init 0″ command is executing . run level 0 is halt . halt -p -> poweroff