GCC COMMANDLINE OPTIONS PART 3

commandline session $cat main.c #include<stdio.h> int main(void) { int i; printf(“n The Geek Stuff [%d]n”, i); return 0; } $gcc -C main.c $ls -l main main main.c main.i main.s $ls -l main. main.c main.i main.s $ls -l main. ls: cannot access main.: No such file or directory $rm main $rm a.out $gcc -C main.c $ls …

free – Display amount of free and used memory in the system

commandline session $free -m -c 10 -s 10 total used free shared buffers cached Mem: 1948 1816 131 0 105 536 -/+ buffers/cache: 1175 773 Swap: 5706 19 5687 total used free shared buffers cached Mem: 1948 1816 131 0 105 536 -/+ buffers/cache: 1175 773 Swap: 5706 19 5687 total used free shared buffers …

xargs AND cd WITH MORE MANIPULATION

ABOUT xargs xargs is a command on Unix and most Unix-like operating systems used to build and execute commands from standard input. It converts input from standard input into arguments to a command. Some commands such as grep and awk can take input either as command-line arguments or from the standard input. However, others such …

grep prints the matching lines – First Character ^

$ 4.2.36 7 507—> grep ^S resume.txt Self Study and Consulting. Software Engineer. Sri Ramakrishna Engineering College, 1996-2000 $ 4.2.36 8 508—> grep ^A resume.txt August 2007 to present. Address: 12/214C Papali Road Vazhakkala. Kakkanad West. $ 4.2.36 9 509—> grep ^J resume.txt July 2005 – June 2007 $ 4.2.36 10 510—> grep ^N resume.txt …

REGULAR EXPRESSION WITH GREP – DOT

grep searches the named input FILEs (or standard input if no files are named, or if a single hyphen-minus (-) is given as file name) for lines containing a match to the given PATTERN. By default, grep prints the matching lines. commandline session $ cat first.txt name-jeffrin Age-35 Sex-Male $ grep 3. first.txt Age-35 $ …

Examining /etc/passwd file in Typical Unix-like OS

ABOUT /etc/passwd file The /etc/passwd file is a text-based database of information about users that may log into the system or other operating system user identities that own running processes. In many operating systems this file is just one of many possible back-ends for the more general passwd name service. The file’s name originates from …

GREP SEARCH STRING USING BACKTICK

$ 4.2.36 7 507—> grep `whoami` algorithm.c to jeffrin@rocketmail.com $ 4.2.36 8 508—> $ 4.2.36 8 508—> whoami jeffrin $ 4.2.36 9 509—> $ 4.2.36 3 503—> grep ls ls2.wav Binary file ls2.wav matches $ 4.2.36 4 504—> grep `ls` ls2.wav grep: 12: Is a directory grep: 2008: Is a directory grep: 2010: Is a …

/proc/meminfo related

# cat /proc/meminfo MemTotal: 1995608 kB MemFree: 77804 kB Buffers: 226640 kB Cached: 306916 kB SwapCached: 1256 kB Active: 817952 kB Inactive: 458696 kB Active(anon): 553568 kB Inactive(anon): 193212 kB Active(file): 264384 kB Inactive(file): 2100484 kB Unevictable: 4696 kB Mlocked: 4696 kB SwapTotal: 5843964 kB SwapFree: 5838604 kB Dirty: 752 kB Writeback: 0 kB AnonPages: …

times – get process times

$times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $ $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.348s 0m0.052s 0m0.560s 0m0.112s $times 0m0.352s 0m0.052s 0m0.560s 0m0.112s $times 0m0.352s 0m0.052s 0m0.560s 0m0.112s $times 0m0.352s 0m0.052s 0m0.560s …

How does && and || operators combination Work ?

commandline session $ 4.2.29 10 510—> [ -f wordmatc.c ] || echo hello hello $ 4.2.29 11 511—> [ -f wordmatc.c ] || cat baty && echo hello cat: baty: No such file or directory $ 4.2.29 12 512—> [ -f wordmatc.c ] && echo hello || echo kitten kitten $ 4.2.29 13 513—> [ …