#navbar { (To hide nav bar in blogger) height: 0px; visibility: hidden; display: none; }

Friday, April 23, 2010

 

Command Line Shortcuts History | Linux command History Trick

Command Line Shortcuts History | Linux command History Trick

Normally in Linux you can recall command by using up and down arrow key using history command you can recall the command from the history list
!! repeat the last command
!char repeats the last command that started with char
!num repeats a command nth history list command
And you can check the command list in history by thorough type
#history
By through these history tricks you can finish work quickly.


 

Disk Management | Create Partition Using fdisk in Linux environment

Disk Management | Create Partition Using fdisk in Linux environment


Disk Management | Create Partition Using fdisk in Linux 
environmentNormally in the windows system we can easily create the partition using disk management similarly In Linux by using fdisk command we can create and delete the partition.In this case I use pen drive for create & delete the partition.First mount the pen drive. For these purpose the user must have the root privileges first login to the root.
Use fdisk command to create partition in pen drive disk file /dev/sdb
Then it will ask to which thinks perform and it also contain help page:
Important commands
n->create new partition
d->delete partition
p->print partition

[root@localhost ~]# fdisk /dev/sdb 

mmand (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): n
Then if you give command
n ->create new partition then it will ask to create which type is it extended-e or primary-p
Primary->it is contain the OS file
Extended -> it is used to store the other user file
First create the primary partition then create extended partition
Command action
e extended
p primary partition (1-4)

p
Partition number (1-4): 1
First cylinder (1-1009, default 1):
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-1009, default 1009): +500MI give the primary partition size is 500MB and partition Number is 1 other things I skip it.
Then create extended partition.
Command (m for help): n
Command action
e extended
p primary partition (1-4)
ePartition number (1-4): 4
First cylinder (252-1009, default 252):
Using default value 252
Last cylinder or +size or +sizeM or +sizeK (252-1009, default 1009): +1G
Give extended partition some large size because you can store your file in the extended and then you can create extended partition only one time the you can't create second extended partition. You can create only logical partition after creating extended partition.

Command (m for help): n
Command action
l logical (5 or over)
p primary partition (1-4)
lFirst cylinder (252-752, default 252):
Using default value 252
Last cylinder or +size or +sizeM or +sizeK (252-752, default 752): +500M
And you can create the logical partition max range is 1GP because you allocate extended partition size is 1GP
Finally perform the all the thing print the partition table
Command (m for help): p
Disk /dev/sdb: 2019 MB, 2019557376 bytes
63 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 3906 * 512 = 1999872 bytes
Device Boot Start End Blocks Id System
/dev/sdb1 1 251 490172 83 Linux
/dev/sdb4 252 752 978453 5 Extended
/dev/sdb5 252 502 490172 83 Linux

Before exit doesn’t forget give the command w it will save your partition other wise whenever you reopen the partition it does not contain the created partition.
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 0: Success.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

 

Give Permission to Separate User Without Changing Pervious Permission

Give Permission to Separate User Without Changing Pervious Permission

Question: now one new user is added to the OS. Now you should give the permission only to this new user for file /bashscript without affecting other user, group, root permission.
For this problem we can use Linux UNIX command acl
Acl-access control list
#mount –o remount /bashscript
#setfacl –m user +rwx /bashscript
You can check there permission by through getfacl command
Note: that director should mount using acl command then only it is work.
By through this method we can give full permission only to new user without changing other user permission
 


 

Linux Basic File Permission File Directory Learn through simple screenshot

Linux Basic File Permission File Directory Learn through simple screenshot

  Linux permission it has the eight type , it contain the type, no of links, date and time…, ScreenShot 1
Access Permission - refer to the files, d refer to the directories, l refers to the link, p means process file, s means socket files, c is the character device Screen Shot 2.
Permission access mode for directory and files Depending upon read write execute it folder and file has the properties - Screen shot 5.
Numerical and Symbolic mode permission Numerical mode 456 Symbolic mode permission rwx - Screen shot 6.
Screenshot 1permission chmod Linux command Screen Shot 2
File and directory linux permission Screen Shot 3
Permission user group and other linux Screen shot 4
Screen shot 5
rwx read write execute permission linux Screen shot 6
Numerical mode symbolic mode linux permission


 

How To Find Linux System Bit Version 32 Bit or 64 Bit Version

There are There Method to Identify the Linux Operating System Bit version.
Is it 32 bit or 64 bit.

First Method
File command is used to identify the file type.
what type of file.
Is it Directory, or ASCII file or Image.

Here In the
/usr/bin directory
it contain list of the binary file
it contain the file name like "file"

if you run command like
rhel5-bash ~ # file /usr/bin/file
/usr/bin/file: ELF 32-bit LSB executable, Intel 80386,version 1 (SYSV),
dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped

You can identify the Linux operating system bit version.

similarly you can run the following command
rhel5-bash ~ # file /sbin/init
/sbin/init: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, stripped

Second Method
uname command is used to identify the system information
rhel5-bash ~ # uname -m
i686
Refer the Link >> what is uname command How to identity the system information.

Third Method
Command getconf
These command is used to identify to get the system configuration variables

rhel5-bash #getconf -a
command it will list of list of configuration variable
Here we can filter CPU bit version through following grep
rhel5-bash ~ # getconf -a | grep LONG_BIT
LONG_BIT                           32
List of getconfg variable
How to identify Linux operating system Bit version
rhel5-bash man # getconf -a
.........................................
............................................
647
INT_MIN -2147483648
IOV_MAX 1024
LOGNAME_MAX 256
LONG_BIT 32
MB_LEN_MAX 16
NGROUPS_MAX 65536
NL_ARGMAX 4096
NL_LANGMAX 2048
NL_MSGMAX 2147483647
NL_NMAX 2147483647
NL_SETMAX 2147483647
NL_TEXTMAX 2147483647
NSS_BUFLEN_GROUP 1024
NSS_BUFLEN_PASSWD 1024
NZERO 20
OPEN_MAX 1024
PAGESIZE 4096
PAGE_SIZE 4096
PASS_MAX 8192
PTHREAD_DESTRUCTOR_ITERATIONS 4
PTHREAD_KEYS_MAX 1024
PTHREAD_STACK_MIN 16384
PTHREAD_THREADS_MAX
SCHAR_MAX 127
SCHAR_MIN -128
SHRT_MAX 32767
SHRT_MIN -32768
SSIZE_MAX 32767
TTY_NAME_MAX 32
TZNAME_MAX 6
UCHAR_MAX 255
UINT_MAX 4294967295
UIO_MAXIOV 1024
ULONG_MAX 4294967295
USHRT_MAX 65535
WORD_BIT 32
_AVPHYS_PAGES 7910
_NPROCESSORS_CONF 1
_NPROCESSORS_ONLN 1
_PHYS_PAGES 256644
_POSIX_ARG_MAX 2097152
_POSIX_ASYNCHRONOUS_IO 200112
_POSIX_CHILD_MAX
_POSIX_FSYNC 200112
_POSIX_JOB_CONTROL 1
_POSIX_MAPPED_FILES 200112
_POSIX_MEMLOCK 200112
_POSIX_MEMLOCK_RANGE 200112
_POSIX_MEMORY_PROTECTION 200112
_POSIX_MESSAGE_PASSING 200112
_POSIX_NGROUPS_MAX 65536
_POSIX_OPEN_MAX 1024
_POSIX_PII
_POSIX_PII_INTERNET
_POSIX_PII_INTERNET_DGRAM
_POSIX_PII_INTERNET_STREAM
_POSIX_PII_OSI
_POSIX_PII_OSI_CLTS
_POSIX_PII_OSI_COTS
_POSIX_PII_OSI_M
_POSIX_PII_SOCKET
_POSIX_PII_XTI
_POSIX_POLL
_POSIX_PRIORITIZED_IO 200112
_POSIX_PRIORITY_SCHEDULING 200112
_POSIX_REALTIME_SIGNALS 200112
_POSIX_SAVED_IDS 1
_POSIX_SELECT
_POSIX_SEMAPHORES 200112
_POSIX_SHARED_MEMORY_OBJECTS 200112
_POSIX_SSIZE_MAX 32767
_POSIX_STREAM_MAX 16
_POSIX_SYNCHRONIZED_IO 200112
_POSIX_THREADS 200112
_POSIX_THREAD_ATTR_STACKADDR 200112
_POSIX_THREAD_ATTR_STACKSIZE 200112
_POSIX_THREAD_PRIORITY_SCHEDULING 200112
_POSIX_THREAD_PRIO_INHERIT 200112
_POSIX_THREAD_PRIO_PROTECT 200112
_POSIX_THREAD_PROCESS_SHARED 200112
_POSIX_THREAD_SAFE_FUNCTIONS 200112
_POSIX_TIMERS 200112
TIMER_MAX
_POSIX_TZNAME_MAX 6
_POSIX_VERSION 200112
_T_IOV_MAX
_XOPEN_CRYPT 1
_XOPEN_ENH_I18N 1
_XOPEN_LEGACY 1
_XOPEN_REALTIME 1
_XOPEN_REALTIME_THREADS 1
_XOPEN_SHM 1
_XOPEN_UNIX 1
_XOPEN_VERSION 600
_XOPEN_XCU_VERSION 4
_XOPEN_XPG2 1
_XOPEN_XPG3 1
_XOPEN_XPG4 1
BC_BASE_MAX 99
BC_DIM_MAX 2048
BC_SCALE_MAX 99
BC_STRING_MAX 1000
CHARCLASS_NAME_MAX 2048
COLL_WEIGHTS_MAX 255
EQUIV_CLASS_MAX
EXPR_NEST_MAX 32
LINE_MAX 2048
POSIX2_BC_BASE_MAX 99
POSIX2_BC_DIM_MAX 2048
POSIX2_BC_SCALE_MAX 99
POSIX2_BC_STRING_MAX 1000
POSIX2_CHAR_TERM 200112
POSIX2_COLL_WEIGHTS_MAX 255
POSIX2_C_BIND 200112
POSIX2_C_DEV 200112
POSIX2_C_VERSION
POSIX2_EXPR_NEST_MAX 32
POSIX2_FORT_DEV
POSIX2_FORT_RUN
_POSIX2_LINE_MAX 2048
POSIX2_LOCALEDEF 200112
POSIX2_RE_DUP_MAX 32767
POSIX2_SW_DEV 200112
POSIX2_UPE
POSIX2_VERSION 200112
RE_DUP_MAX 32767
PATH /bin:/usr/bin
CS_PATH /bin:/usr/bin
LFS_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LFS_LDFLAGS
LFS_LIBS
LFS_LINTFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
LFS64_CFLAGS -D_LARGEFILE64_SOURCE
LFS64_LDFLAGS
LFS64_LIBS
LFS64_LINTFLAGS -D_LARGEFILE64_SOURCE
_XBS5_ILP32_OFF32 1
XBS5_ILP32_OFF32_CFLAGS -m32
XBS5_ILP32_OFF32_LDFLAGS -m32
XBS5_ILP32_OFF32_LIBS
XBS5_ILP32_OFF32_LINTFLAGS
_XBS5_ILP32_OFFBIG 1
XBS5_ILP32_OFFBIG_CFLAGS -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
XBS5_ILP32_OFFBIG_LDFLAGS -m32
XBS5_ILP32_OFFBIG_LIBS
XBS5_ILP32_OFFBIG_LINTFLAGS
_XBS5_LP64_OFF64
XBS5_LP64_OFF64_CFLAGS
XBS5_LP64_OFF64_LDFLAGS
XBS5_LP64_OFF64_LIBS
XBS5_LP64_OFF64_LINTFLAGS
_XBS5_LPBIG_OFFBIG
XBS5_LPBIG_OFFBIG_CFLAGS
XBS5_LPBIG_OFFBIG_LDFLAGS
XBS5_LPBIG_OFFBIG_LIBS
XBS5_LPBIG_OFFBIG_LINTFLAGS
_POSIX_V6_ILP32_OFF32 1
POSIX_V6_ILP32_OFF32_CFLAGS -m32
POSIX_V6_ILP32_OFF32_LDFLAGS -m32
POSIX_V6_ILP32_OFF32_LIBS
POSIX_V6_ILP32_OFF32_LINTFLAGS
_POSIX_V6_WIDTH_RESTRICTED_ENVS POSIX_V6_ILP32_OFF32
POSIX_V6_ILP32_OFFBIG
POSIX_V6_WIDTH_RESTRICTED_ENVS POSIX_V6_ILP32_OFF32
POSIX_V6_ILP32_OFFBIG
_POSIX_V6_ILP32_OFFBIG 1
POSIX_V6_ILP32_OFFBIG_CFLAGS -m32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
POSIX_V6_ILP32_OFFBIG_LDFLAGS -m32
POSIX_V6_ILP32_OFFBIG_LIBS
POSIX_V6_ILP32_OFFBIG_LINTFLAGS
_POSIX_V6_LP64_OFF64
POSIX_V6_LP64_OFF64_CFLAGS
POSIX_V6_LP64_OFF64_LDFLAGS
POSIX_V6_LP64_OFF64_LIBS
POSIX_V6_LP64_OFF64_LINTFLAGS
_POSIX_V6_LPBIG_OFFBIG
POSIX_V6_LPBIG_OFFBIG_CFLAGS
POSIX_V6_LPBIG_OFFBIG_LDFLAGS
POSIX_V6_LPBIG_OFFBIG_LIBS
POSIX_V6_LPBIG_OFFBIG_LINTFLAGS
_POSIX_ADVISORY_INFO 200112
_POSIX_BARRIERS 200112
_POSIX_BASE
_POSIX_C_LANG_rhel5
_POSIX_C_LANG_rhel5_R
_POSIX_CLOCK_SELECTION 200112
_POSIX_CPUTIME 200112
_POSIX_THREAD_CPUTIME 200112
_POSIX_DEVICE_SPECIFIC
_POSIX_DEVICE_SPECIFIC_R
_POSIX_FD_MGMT
_POSIX_FIFO
_POSIX_PIPE
_POSIX_FILE_ATTRIBUTES
_POSIX_FILE_LOCKING
_POSIX_FILE_SYSTEM
_POSIX_MONOTONIC_CLOCK 200112
_POSIX_MULTI_PROCESS
_POSIX_SINGLE_PROCESS
_POSIX_NETWORKING
_POSIX_READER_WRITER_LOCKS 200112
_POSIX_SPIN_LOCKS 200112
_POSIX_REGEXP 1
_REGEX_VERSION
_POSIX_SHELL 1
_POSIX_SIGNALS
_POSIX_SPAWN 200112
_POSIX_SPORADIC_SERVER
_POSIX_THREAD_SPORADIC_SERVER
_POSIX_SYSTEM_DATABASE
_POSIX_SYSTEM_DATABASE_R
_POSIX_TIMEOUTS 200112
_POSIX_TYPED_MEMORY_OBJECTS
_POSIX_USER_GROUPS
_POSIX_USER_GROUPS_R
POSIX2_PBS
POSIX2_PBS_ACCOUNTING
POSIX2_PBS_LOCATE
POSIX2_PBS_TRACK
POSIX2_PBS_MESSAGE
SYMLOOP_MAX
STREAM_MAX 16
AIO_LISTIO_MAX
AIO_MAX
AIO_PRIO_DELTA_MAX 20
DELAYTIMER_MAX 2147483647
HOST_NAME_MAX 64
LOGIN_NAME_MAX 256
MQ_OPEN_MAX
MQ_PRIO_MAX 32768
_POSIX_DEVICE_IO
_POSIX_TRACE
_POSIX_TRACE_EVENT_FILTER
_POSIX_TRACE_INHERIT
_POSIX_TRACE_LOG
RTSIG_MAX 32
SEM_NSEMS_MAX
SEM_VALUE_MAX 2147483647
SIGQUEUE_MAX
FILESIZEBITS 64
POSIX_ALLOC_SIZE_MIN 4096
POSIX_REC_INCR_XFER_SIZE
POSIX_REC_MAX_XFER_SIZE
POSIX_REC_MIN_XFER_SIZE 4096
POSIX_REC_XFER_ALIGN 4096
SYMLINK_MAX
GNU_LIBC_VERSION glibc 2.9
GNU_LIBPTHREAD_VERSION NPTL 2.9
POSIX2_SYMLINKS 1
LEVEL1_ICACHE_SIZE 0
LEVEL1_ICACHE_ASSOC 0
LEVEL1_ICACHE_LINESIZE 0
LEVEL1_DCACHE_SIZE 16384
LEVEL1_DCACHE_ASSOC 8
LEVEL1_DCACHE_LINESIZE 64
LEVEL2_CACHE_SIZE 262144
LEVEL2_CACHE_ASSOC 4
LEVEL2_CACHE_LINESIZE 64
LEVEL3_CACHE_SIZE
LEVEL3_CACHE_ASSOC
LEVEL3_CACHE_LINESIZE
LEVEL4_CACHE_SIZE 0
LEVEL4_CACHE_ASSOC 0
LEVEL4_CACHE_LINESIZE 0
IPV6 200112
RAW_SOCKETS 200112
How to identify Linux operating system Bit version | Configuration Information Uname File /use/bin /sbin/init command.

 

Linux uname command print Basic system Hardware and software information

Uname command used to find the basic information about that information about which Operating system has been used. What is the kernel version? When it is released

-a Print the basic of the all information
rpmsupport-4 ~/Desktop $ uname -a
Linux jkumar 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux
-s which Operating system has been used
rpmsupport-4 ~/Desktop $ uname -s
Linux


-o related to OS
rpmsupport-4 ~/Desktop $ uname -o
GNU/Linux

rpmsupport-4 ~/Desktop $ uname
Linux

-n refer to the Hostname or local host
rpmsupport-4 ~/Desktop $ uname -n
jkumar

-v Operation System version
rpmsupport-4 ~/Desktop $ uname -v
#42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009

-r OS release level
rpmsupport-4 ~/Desktop $ uname -r
2.6.28-11-generic

 

Download and Install Wine RPM Package Resolve Dependency Error

To run the windows application in Linux we need wine .
Using wine we can run windows games , windows media player, vlc player, software in Linux,
First we need to download the wine package
While I try to install wine rpm package I go the following Dependency Error message.

[root@r-n-cluster1 Desktop]# rpm -ivh wine-20031213-1mdd.i586.rpm

warning: wine-20031213-1mdd.i586.rpm: Header V3 DSA signature: NOKEY, key ID ce6cc711
error: Failed dependencies:
freetype2 is needed by wine-20031213-1mdd.i586
perl-base is needed by wine-20031213-1mdd.i586
libartsc.so.0 is needed by wine-20031213-1mdd.i586
libaudio.so.2 is needed by wine-20031213-1mdd.i586
libungif.so.4 is needed by wine-20031213-1mdd.i586
[root@r-n-cluster1 Desktop]# rpm -ivh wine-core-1.1.9-2.fc8.i386.rpm
warning: wine-core-1.1.9-2.fc8.i386.rpm: Header V3 DSA signature: NOKEY, key ID 6df2196f
error: Failed dependencies:
libc.so.6(GLIBC_2.7) is needed by wine-core-1.1.9-2.fc8.i386
Missing Dependency: perl-base is needed by package wine
Missing Dependency: libaudio.so.2 is needed by package wine
freetype2 is needed by package wine

Download the following rpm package .
For these one You will not face any issue
Download wine package from the following link

DOWNLOAD WINE PACKAGE

Then install these rpm package
[bash@wine]# rpm –ivh wine*
After installation
You can run window application .exe file
[bash@wine]# wine application.exe

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]