Tag: Wikipedia

bash debug – log all executed commands

Screenshot of a Bash 3.1 session demonstrating...
Screenshot of a Bash 3.1 session demonstrating its particularities. Shows exporting a variable, alias, type, Bash’s kill, environment variables PS1, BASH_VERSION and SHELLOPTS, redirecting standard output and standard error and history expansion. A POSIX session is launched from a normal session. Finally, the POSIX session kills itself (since just “exit” would be too boring). (Photo credit: Wikipedia)

Whenever I am writing a script in perl or bash, I always wish that there
was some way to have all the commands logged or output to screen. I know
there is “set -x” option to have debugging enabled, but sometimes that
seems to be too much information and I dont really need all that. So, here
is something I found recently for bash to log all the executed commands.

trap "echo $BASH_COMMAND" DEBUG

This will echo/print all the commands on the stdout.

 

Enhanced by Zemanta

find more information on ext2/3/4 filesystem

English: Ext3 & Ext4 file systems: fsck time v...
English: Ext3 & Ext4 file systems: fsck time vs Inode Count (Photo credit: Wikipedia)

In my previous post on check filesystem regurlarly, I mentioned tune2fs. That tool give quite a lot of information. But just in case, you did not find what you are looking for in the output, then you can get much more information on these partitions with the dumpe2fs command.

dumpe2fs

You do really get a lot of information, and here are some of them:

Filesystem volume name
Last mounted on
Filesystem UUID
Filesystem magic number
Filesystem revision #
Filesystem features
Filesystem flags
Default mount options
Filesystem state
Errors behavior
Filesystem OS type
Inode count
Block count
Reserved block count
Free blocks
Free inodes
First block
Block size
Fragment size
Reserved GDT blocks
Blocks per group
Fragments per group
Inodes per group
Inode blocks per group
Flex block group size
Filesystem created
Last mount time
Last write time
Mount count
Maximum mount count
Last checked
Check interval
Next check after
Lifetime writes
Reserved blocks uid
Reserved blocks gid
First inode
Inode size
Required extra isize
Desired extra isize
Journal inode
Default directory hash
Directory Hash Seed
Journal backup
Journal features
Journal size
Journal length
Journal sequence
Journal start

and much more……

 

Enhanced by Zemanta

Fedora – Ramdisk creation

In Fedora, ramdisks are not created by default as is the case with RHEL. So, if you need to get Ramdisks on Fedora, then you can do this:

sudo yum install MAKEDEV

This will create some default Ramdisk’s in the “/dev” directory. Now, if you need to change anything then feel free to go to “/etc/makedev.d” and feel free to change these files.

The Fedora Project logo
The Fedora Project logo (Photo credit: Wikipedia)

 

Enhanced by Zemanta