https://raw.githubusercontent.com/ahiliation/beautifulwork-programmingpractice/master/simple_write-p1.c
Category Archives: operating system
How to write a shell script to find the greatest among three numbers ?
#!/bin/bash # # Linux Shell Scripting Tutorial 1.05r3, Summer-2002 # # Written by Vivek G. Gite <vivek@nixcraft.com> # modified by Jeffrin Jose T. <ahiliation@yahoo.co.in> # Latest version can be found at http://www.nixcraft.com/ # # Q2. Script to find out biggest number # # Algo: # 1) START: Take three nos as n1,n2,n3. # 2) Is …
Continue reading “How to write a shell script to find the greatest among three numbers ?”
pr – convert text files for printing
The following shows a command line session with pr command which helps in displaying contents of a file in shell scripts. $cat lkg.txt A for Apple B for Ball C for Cat D for Donkey E for Elephant F for Fox G for Goat H for Horse I for Insect $pr -l 10 lkg.txt A …
chattr practice session . I
The following shows a command line session with chattr command which helps in changing attributes of files. $lsattr functions.txt ————-e– functions.txt $chattr -e functions.txt chattr: Clearing extent flag not supported on functions.txt $lsattr functions.txt ————-e– functions.txt $chattr +c functions.txt $lsattr functions.txt ——–c—-e– functions.txt $lsattr functions.txt ——–c—-e– functions.txt $chattr +a functions.txt chattr: Operation not permitted while …
Looking into a lsattr practice session .
ABOUT lsattr The following shows a command line session with lsattr command which helps in listing file attributes. [bash] $pwd /proc $lsattr lsattr: Inappropriate ioctl for device While reading flags on ./asound lsattr: Permission denied While reading flags on ./sysrq-trigger lsattr: Inappropriate ioctl for device While reading flags on ./partitions lsattr: Inappropriate ioctl for device …
lsattr practice session . IV
The following shows a command line session with lsattr command which helps in listing file attributes. root>(time lsattr ) &>> lsattr-with-time.txt root>cat lsattr-with-time.txt lsattr: Inappropriate ioctl for device While reading flags on ./sys lsattr: Inappropriate ioctl for device While reading flags on ./dev lsattr: Operation not supported While reading flags on ./initrd.img lsattr: Inappropriate ioctl …
lsattr practice session . III
The following shows a command line session with lsattr command which helps in listing file attributes. $lsattr ————-e– ./(2561).jpg ————-e– ./(1596).jpg ————-e– ./(2551).jpg ————-e– ./(2157).jpg ————-e– ./(2053).jpg ————-e– ./(1793).jpg ————-e– ./(1917).jpg ————-e– ./shortlisted ————-e– ./(1722).jpg ————-e– ./(1881).jpg ————-e– ./(1654).jpg $lsattr /home/jeffrin/.bash_history ————-e– /home/jeffrin/.bash_history $lsattr /home/jeffrin/.gnome2 ————-e– /home/jeffrin/.gnome2/keyrings ————-e– /home/jeffrin/.gnome2/accels $lsattr /home/jeffrin/.m .mission-control/ .mplayer/ .muttrc .muttrc-personal …
lsattr practice session . II
The following shows a command line session with lsattr command which helps in listing file attributes. $lsattr ————-e– ./A.txt ————-e– ./beautyastudyin00rothuoft.pdf ————-e– ./trueprint-5.4.tar.gz.sig ————-e– ./sample ————-e– ./scsh-common-0.6_0.6.7-8_all.deb ————-e– ./photos ————-e– ./beautifulwork-sorting ————-e– ./Templates ————-e– ./apache2_2.4.7-1_amd64.deb ————-e– ./Pictures ————-e– ./a.out ————-e– ./sent ————-e– ./Videos ————-e– ./functions.txt~ ————-e– ./Desktop ————-e– ./books ————-e– ./myapp.rb ————-e– ./tmp ————-e– ./ethstatus_0.4.3.dsc …
lsattr – list file attributes on a ext2fs
The following shows a command line session with lsattr and stat commands which helps in listing file attributes. $lsattr -v colors 1936034688 ————-e– colors $lsattr colors ————-e– colors $ls -l colors -rw-r–r– 1 jeffrin jeffrin 173 Feb 17 21:46 colors $stat colors File: ‘colors’ Size: 173 Blocks: 8 IO Block: 4096 regular file Device: 801h/2049d …
Continue reading “lsattr – list file attributes on a ext2fs”
What does true and false commands do ?
commandline session $true $true $? $echo $? 0 $false $echo $? 1 $echo $? 0 $echo $? 0 $false ; true $echo $? 0 $true ; false ; echo $? 1 $true ; false ; echo $? 1 $true ; false ; echo $? 1 $true ; false ; echo $? ; echo $? 1 …